web实验2

  • 内容相对于浏览器居中,宽860px
  • 鼠标移动至列表项上,显示背景色#F8F8F8
  • 分割线2px solid #ccc,每项高130px
  • 第一行文字:20px 黑体
  • 标签:字颜色#cccc00 16px
  • 标签项:背景颜色#eee 字体颜色#999 文字大小14px
  • 第三行文字:边框1px solid #eee; 圆角半径25px
    <!DOCTYPE html>
    <html lang="en">
    <head>
        <meta charset="UTF-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <title>Document</title>
        <style>
            *{
                margin: 0;
                padding: 0;
            }
            ul li{
                list-style: none;
            }
            ul li a{
                margin: 0 auto;
                width: 860px;
                height: 130px;
                border-top: 2px solid #ccc;
                display:block;
                text-decoration: none;
                margin-top: 10px;
            }
            ul li #a1{
                background-image: url(img2/4.jpg);
                background-position: left center;
                background-repeat: no-repeat;
                background-size: 20%;
            }
            ul li #a2{
                background-image: url(img2/5.jpg);
                background-position: left center;
                background-repeat: no-repeat;
                background-size: 20%;
            }
            ul li #a3{
                background-image: url(img2/6.jpg);
                background-position: left center;
                background-repeat: no-repeat;
                background-size: 20%;
            }
            ul li .text{
                margin-left: 200px;
                margin-top: 20px;
            }
            ul li .text div{
                margin-top: 15px;
            }
            ul li .text h5{
                font-size: 20px;
                font-family: "黑体";
                color: black;
            }
            ul li .text .label{
                color: #cccc00;
                font-size: 16px;
                /* margin: 10px; */
            }
            ul li .text .label2{
                background-color: #eee;
                color: #999;
                font-size: 14px;
                /* margin: 10px; */
            }
            ul li .text .label1{
                border:1px solid #eee;
                border-radius: 25px;
                margin-top: 10px;
                color: #999;
                font-size: 15px;
            }
            ul li .text .time{
                color: #999;
                font-size: 15px;
            }
            ul li a:hover{
                background-color: #F8F8F8;
            }
        </style>
    </head>
    <body>
        <ul>
            <li>
                <a href="" id ="a1">
                    <div class = "text">
                        <div>
                            <h5>不只看肤色挑唇膏 选对衣服口红衣服更美</h5>
                        </div>
    
                        <div>   
                            <span class = "label">标签</span>
                            <span class="label2">唇膏</span>
                            <span class="label2">衣服</span>
                            <span class="label2">粉色</span>
                            <span class="label2">化妆</span>
                            <span class="label2">美容美体</span>
                        </div>
    
                        <div>   
                            <span class="label1">悦己self</span>
                            <span class="time">2016-10-18</span>
                        </div>
                    </div>
                </a>
            </li>
            <li>
                <a href="" id ="a2">
                    <div class = "text">
                        <div>
                            <h5>学画红唇妆 让你的女王范分分钟秒杀路人</h5>
                        </div>
    
                        <div>   
                            <span class = "label">标签</span>
                            <span class="label2">唇膏</span>
                            <span class="label2">衣服</span>
                            <span class="label2">粉色</span>
                            <span class="label2">化妆</span>
                            <span class="label2">美容美体</span>
                        </div>
    
                        <div>   
                            <span class="label1">毛戈平形象艺术学校</span>
                            <span class="time">2016-10-18</span>
                        </div>
                    </div>
                </a>
            
            </li>
            
            <li>
                <a href="" id ="a3">
                    <div class = "text">
                        <div>
                            <h5>无数次给国外博主跪了 把自己的脸画成漫画人物好逼真</h5>
                        </div>
    
                        <div>   
                            <span class = "label">标签</span>
                            <span class="label2">美容美体</span>
                        </div>
    
                        <div>   
                            <span class="label1">八公举</span>
                            <span class="time">2016-10-18</span>
                        </div>
                    </div>
                </a>
            </li>
        </ul>
    </body>
    </html>

    tab栏切换显示不同

    <!DOCTYPE html>
    <html lang="en">
    <head>
        <meta charset="UTF-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <title>Document</title>
        <style>
            *{
                padding: 0;
                margin: 0;
            }
            /* body{
                /* position: fixed; */
            
            .title{
                width: 1100px;
                height: 40px;
                background-color: #999;
            }
            .title a{
                /* height: 40px; */
                width: 70px;    
                color: white;
                margin-left: 40px;
                line-height: 40px;
                font-size: 17px;
                display: inline-block;
            }
            .title a:hover{
                color: red;
            }
            div{
                width: 500px;
                height: 300px;
                /* float: left; */
            }
            .news p{
                font-weight: 700;
                font-size: 25px;
                margin-bottom: 20px;
            }
            .news{
                margin-right: 60px;
                margin-left: 20px;
                margin-top: 50px;
                display: inline-block;
                /* float: left; */
            }
            .news ul li{
                list-style: none;
                padding: 10px 0;
            }
            .news ul li .time{
                float: right;
            }
            .news ul li .context{
                margin-left: 20px;
            }
            .foot{
                margin: 0 500px;
            }
            .foot a{
                color: black;
                font-weight: 500;
            }
    </style>
    </head>
    <body>
        <div class="title">
            <a href="">首页</a>
            <a href="">新闻</a>
            <a href="">体育</a>
            <a href="">娱乐</a>
            <a href="">财经</a>
            <a href="">科技</a>
            <a href="">手机</a>
            <a href="">数码</a>
        </div>
    
        <div class="news">
            <p>娱乐新闻</p>
            <ul>
                <li>
                    <a class="context">家都不想在里面混</a>
                    <a class="time">2018-10-1</a>
                </li>
                <li>
                    <a class="context">谍中谍</a>
                    <a class="time">2018-10-1</a>
                </li>
                <li>
                    <a class="context">灾难发</a>
                    <a class="time">2018-10-1</a>
                </li>
                <li>
                    <a class="context">多部好莱坞大片登陆中国</a>
                    <a class="time">2018-10-1</a>
                </li>
            </ul>
        </div>
        
    
        <div class="news">
            <p>军事新闻</p>
            <ul>
                <li>
                    <a class="context">3日9:00开始</a>
                    <a class="time">2018-10-1</a>
                </li>
                <li>
                    <a class="context">告诫</a>
                    <a class="time">2018-10-1</a>
                </li>
                <li>
                    <a class="context">网站开设关</a>
                    <a class="time">2018-10-1</a>
                </li>
                <li>
                    <a class="context">尽出</a>
                    <a class="time">2018-10-1</a>
                </li>
            </ul>
        </div>
    
        <div class="news">
            <p>数码新闻</p>
            <ul>
                <li>
                    <a class="context">微软</a>
                    <a class="time">2018-10-1</a>
                </li>
                <li>
                    <a class="context">平板电脑五年走到市场拐点</a>
                    <a class="time">2018-10-1</a>
                </li>
                <li>
                    <a class="context">苹果邀请函解密Hint有新释义</a>
                    <a class="time">2018-10-1</a>
                </li>
                <li>
                    <a class="context">IDF2018英特尔谷歌联手</a>
                    <a class="time">2018-10-1</a>
                </li>
            </ul>    
        </div>
    
        <div class="news">
            <p>手机新闻</p>
            <ul>
                <li>
                    <a class="context">超大运行内存手机推荐</a>
                    <a class="time">2018-10-1</a>
                </li>
                <li>
                    <a class="context">国产旗舰手机盘点</a>
                    <a class="time">2018-10-1</a>
                </li>
                <li>
                    <a class="context">西门子归来 首款智能机配置强跑分出色</a>
                    <a class="time">2018-10-1</a>
                </li>
                <li>
                    <a class="context">骗子植入手机木马的10大招数</a>
                    <a class="time">2018-10-1</a>
                </li>
            </ul>
        </div>
        
    
        <div class="foot">
            <a href="">关于我们</a>
            <a href="">联系我们</a>
        </div>
    </body>
    </html>

  • 表单宽248px,高220px,背景色#F5EAE8,上下内边距30px  左右内边距40px,边框1px solid #F5EAE8
  • 输入框宽250px,高38px,边框1px solid #CCC,下外边距30px。文本缩进50px,便于显示前方图标。前方图标可考虑背景图片进行设置。
  • 按钮宽255px,高44px,外边距上下25px,左右居中
  • 合作网站区域宽330px 高145px,背景颜色#F5EAE8,上边框1px solid #ddd
  • 内容居中显示
  • <!DOCTYPE html>
    <html lang="en">
    <head>
        <meta charset="UTF-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <title>Document</title>
        <style>
            body{
                background-color: #F5EAE8;
            }
            .main{
                width: 260px;
                height: 220px;
                padding: 20px 30px;
                border: 1px solid #999;
            }
            .ad{
                width: 300px;
                height: 150px;
                padding: 0 20px 0 20px;
                text-align: center;
                /* border: 1px solid #999; */
                margin-top: 20px;
            }
            .main .input1{
                width: 250px;
                height: 30px;
                border: 1px solid #ccc;
                font-size: 13px;
                background-image: url(img2/zhanghao.jpg);
                background-repeat: no-repeat;
                background-position: left;
                text-indent: 50px;
            }
            .main .input2{
                width: 250px;
                height: 30px;
                border: 1px solid #ccc;
                font-size: 13px;
                background-image: url(img2/mima.jpg);
                background-repeat: no-repeat;
                background-position: left;
                text-indent: 50px;
                margin-top: 25px;
            }
            .main .check{
                margin-top: 30px;
            }
            .main .check label{
                font-size: 10px;
            }
            .main .check span{
                font-size: 10px;
                color: #999;
                margin-left: 10px;
            }
            .main .btn{
                width: 255px;
                height: 44px;
                text-align: center;
                background-image: url(img2/but.jpg);
                background-repeat: no-repeat;
                margin-top: 20px;
            }
            .ad a{
                text-decoration: none;
                color: black;
                font-size: 15px;
            }
        </style>
    </head>
    <body>
        <div class="main">
            <input type="text" class="input1" placeholder="用户名/邮箱地址/手机号" style="position: static;">
            <input type="password" class="input2" placeholder="填写密码" style="position: static;">
            <div class="check">
                <input type="checkbox">
                <label >记住密码</label>
                <span>欢迎注册</span><span>忘记密码</span>
            </div>
            <div class="btn">
                <!-- <button></button> -->
            </div>
        </div>
    
        <div class="ad">
            <a href="">合作账号登录:</a>
            <img src="img2/weixin.png" alt="">
            <img src="img2/qqlogin.png" alt="">
            <img src="img2/taobao.png" alt="">
        </div>
        
    </body>
    </html>

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值