综合案例-新闻列表

分析:分两块:标题+内容

内容:li标签前面的图片起装饰作用,图片作为背景即可,如图。

代码:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>新闻标签</title>
    <style>
        *{
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }
        li{
            list-style: none;  
        }
        a{
            text-decoration: none;
        }
        .news{
            margin: 100px auto;
            width: 360px;
            height: 200px;
            
        }
        .news .hd{
            height: 34px;
            background-color: #eee;
            border: 1px solid #dbdee1;
            border-left: 0;
        }
        .news .hd a{ 
            margin-top: -1px;
            display: inline-block; 
            border-top: 3px solid #ff8400;
            border-right: 1px solid #dbdee1;
            width: 48px;
            height: 34px;
            background-color: #fff;

            text-align: center;
            line-height: 32px;
            font-size: 14px;
            color: #333;
           
        }

        .news .bd{
            padding: 5px;
        }
        .news .bd li{
            padding-left: 15px;
            background-image: url(./square.png);
            background-repeat: no-repeat;
            background-position: 0 center;
        }
        .news .bd li a{
            padding-left: 20px;
            background-image: url(./img.gif);
            background-repeat:no-repeat;
            background-position: 0 center;
            color: #666;
            font-size: 12px;
            line-height: 24px;
        }
        .news .bd li a:hover{
            color: #ff8400;
        }
    </style>
</head>
<body>
    <!-- 新闻区域  包含  标题——内容 -->
    <div class="news">
        <!-- 标题 -->
        <div class="hd">
            <a href="#">新闻</a>
        </div>

        <!-- 内容 -->
        <div class="bd">
            <ul>
                <li>
                    <a href="#">点赞“新农人” 温暖的伸手</a>   
                </li>
                <li>
                    <a href="#">在希望的田野上...</a>
                </li>
                <li>
                    <a href="#">”中国天眼”又有新发现 已在《自然》杂志发表</a>
                </li>
                <li>
                      <a href="#">急!这个领域,缺人!月薪4万元还不好招!啥情况?</a>
                </li>
                <li>
                    <a href="#">G9“带货”背后:亏损面持续扩大,竞争环境激烈</a>
                </li>
                <li>
                    <a href="#">多地力推二手房“带押过户”,有什么好处?</a>
                </li>
            </ul>
        </div>
    </div>
</body>
</html>

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值