Web实现:微博头部开发实例

78 篇文章 2 订阅
68 篇文章 0 订阅

HTML部分代码:

<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <title>微博实战--head</title>
    <link rel="stylesheet" href="index.css">
</head>

<body>
    <div class="outer-tile">
        <header class="clearFix">
            <div class="left">
                <div class="img"></div>
                <div class="input-box">
                    <input type="text" placeholder="大家正在搜:中国队开赛三天已超上届金牌总数">
                    <span class="search"></span>
                </div>
            </div>
            <div class="right">
                <ul class="nav clearFix">
                    <li>
                        <span class="first-page"></span>
                        首页
                    </li>
                    <li>
                        <span class="video"></span>
                        视频
                    </li>
                    <li>
                        <span class="find"></span>
                        发现
                    </li>
                    <li>
                        <span class="game"></span>
                        游戏
                    </li>
                </ul>
                <ul class="regist-login">
                    <li>注册</li>
                    <li>|</li>
                    <li>登录</li>
                </ul>
            </div>
        </header>
    </div>
</body>

</html>

CSS部分代码:

* {
    margin: 0px;
    padding: 0px;
}

ul {
    list-style: none;
}

.clearFix::after {
    display: block;
    content: '';
    clear: both;
}

.outer-tile {
    width: 1440px;
    background: #ffffff;
    box-shadow: 0px 0px 1px rgba(0, 0, 0, 0.3);
}

header {
    box-sizing: border-box;
    width: 1225px;
    height: 50px;
    margin: 0 auto;
}

.left {
    float: left;
}

.left>div {
    float: left;
}

.left .img {
    width: 80px;
    height: 50px;
    background: url(./images/weibo-header.png) no-repeat center;
    background-size: contain;
}

.left .input-box {
    position: relative;
    width: 470px;
    height: 30px;
    margin-top: 11px;
    margin-left: 30px;
    border: 1px solid #CCCCCC;
    box-sizing: border-box;
    background-color: #F2F2F2;

}

.left .input-box input {
    box-sizing: border-box;
    width: 100%;
    height: 28px;
    border: none;
    background-color: transparent;
    font-size: 12px;
    color: #808080;
    padding-left: 10px;
    padding-right: 35px;
    line-height: 29px;
    outline: 0;
}

.left .input-box span {
    position: absolute;
    width: 16px;
    height: 28px;
    line-height: 28px;
    top: 0px;
    right: 15px;
    background: url(./images/search.png) no-repeat center;
    background-size: contain;
}

.right {
    float: right;
    line-height: 50px;
}

.right ul {
    float: left;
}

.right .nav {
    margin-right: 30px;
}

.right .nav li {
    position: relative;
    float: left;
    margin-right: 15px;
    font-size: 12px;
    line-height: 50px;
    padding-left: 22px;
}

.right .nav li:last-child {
    margin-right: 0px;
}

.right .nav span {
    position: absolute;
    top: 16px;
    left: 0px;
    width: 17px;
    height: 17px;
}

.right .nav .first-page {
    background: url(./images/first-page.png) no-repeat center;
    background-size: contain;
}

.right .nav .video {
    background: url(./images/video.png) no-repeat center;
    background-size: contain;
}

.right .nav .find {
    background: url(./images/find.png) no-repeat center;
    background-size: contain;
}

.right .nav .game {
    background: url(./images/game.png) no-repeat center;
    background-size: contain;
}

.right .regist-login li {
    float: left;
    font-size: 12px;
}

.right .regist-login li:nth-child(2) {
    margin: 0 10px;
    color: #D9D9D9;
}
  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

jasmyn518

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值