CSS学习18之小试牛刀

小试牛刀

到现在为止,我们已经将css要学习的初级中级高级知识都已经学完了,接下来我们就应该对自己做一个小测验了,以下就是我的小测验,模拟qq会员官网的头部栏!

素材

bg.png背景图
在这里插入图片描述
logo.png 企鹅logo图
在这里插入图片描述

qqvip官网头部栏示例

代码
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>qq会员官网头部栏</title>
    <style>
        body,a,div{
            margin: 0;
            padding: 0;
            text-decoration: none;
        }
        body{
            background-image: url("images/bg.png");
            background-repeat: no-repeat;
        }
        ul{
            margin: 0;
            padding: 0;
            list-style: none;
        }
        #app{
            position: relative;
            width: 100%;
            height: 150px;
            background: #282424;
            overflow: hidden;
        }
        #logo{
            position: fixed;
            display: inline-block;
            float: left;
        }
        #login{
            position: relative;
            display: inline-block;
            right: -400px;
            top: 60px;
            border: 2px yellow solid;
            border-radius: 45px;
        }
        #login a{
            text-align: center;
            font: 20px bold;
            line-height: 40px;
            display: inline-block;
            width: 80px;
            height: 40px;
            color: yellow;
        }
        #login:hover{
            background: #939331;
        }
        #register{
            position: relative;
            display: inline-block;
            border: 2px yellow solid;
            border-radius: 45px;
            right: -450px;
            top: 60px;
            background: #939331;
        }
        #register a{
            text-align: center;
            font: 20px bold;
            line-height: 40px;
            display: inline-block;
            width: 200px;
            height: 40px;
            color: yellow;
        }
        #list{
            position: relative;
            display: inline-block;
            width: 600px;
            height: 50px;
            left: 400px;
            top: 60px;
        }
        #list a{
            text-align: center;
            font: 14px bold;
            line-height: 50px;
            display: inline-block;
            width: 90px;
            height: 50px;
            color: white;
        }
        #list a:hover{
            color: red;
        }
    </style>
</head>
<body>

<div id="app">
    <div id="logo">
        <img src="images/qqviplogo.png" alt="vip">
    </div>
    <div id="list">
            <a href="">靓号站&emsp;</a>
            <a href="">功能特权&emsp;</a>
            <a href="">游戏特权&emsp;</a>
            <a href="">成长体系&emsp;</a>
            <a href="">年费专区&emsp;</a>
            <a href="">免流量特权&emsp;</a>
    </div>
    <div id="login">
        <a href="#">登录</a>
    </div>
    <div id="register">
        <a href="">开通超级会员</a>
    </div>
</div>

</body>
</html>
效果

在这里插入图片描述

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值