美文网首页
练习题—新闻列表

练习题—新闻列表

作者: qianxun0921 | 来源:发表于2018-09-14 12:01 被阅读0次

HTML代码如下:

<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
        <title>新闻列表</title>
        <link rel="stylesheet" type="text/css" href="css/new_list.css"/>
    </head>
    <body>
        <div class="box">
            <div class="header">
                <p class="title">新闻列表</p>
            </div>
            <ul>
                <li><a href="#" class="border1"><img src="img/dot.gif" class="dot"/>&nbsp;&nbsp;<img src="img/icon.jpg"/>&nbsp;&nbsp;崔龙洙解苏宁因何打动他 要以学习的姿态去中超</a><a href="#" class="time">2016-06-23</a></li>
                <li><a href="#" class="h2"><img src="img/dot.gif" class="dot"/>&nbsp;&nbsp;<img src="img/icon.jpg"/>&nbsp;&nbsp;崔龙洙解苏宁因何打动他 要以学习的姿态去中超</a><a href="#" class="time">2016-06-23</a></li>
                <li><a href="#" class="h2"><img src="img/dot.gif" class="dot"/>&nbsp;&nbsp;<img src="img/icon.jpg"/>&nbsp;&nbsp;崔龙洙解苏宁因何打动他 要以学习的姿态去中超</a><a href="#" class="time">2016-06-23</a></li>
                <li><a href="#" class="h2"><img src="img/dot.gif" class="dot"/>&nbsp;&nbsp;<img src="img/icon.jpg"/>&nbsp;&nbsp;崔龙洙解苏宁因何打动他 要以学习的姿态去中超</a><a href="#" class="time">2016-06-23</a></li>
                <li><a href="#" class="h2"><img src="img/dot.gif" class="dot"/>&nbsp;&nbsp;<img src="img/icon.jpg"/>&nbsp;&nbsp;崔龙洙解苏宁因何打动他 要以学习的姿态去中超</a><a href="#" class="time">2016-06-23</a></li>
                <li><a href="#" class="h2"><img src="img/dot.gif" class="dot"/>&nbsp;&nbsp;<img src="img/icon.jpg"/>&nbsp;&nbsp;崔龙洙解苏宁因何打动他 要以学习的姿态去中超</a><a href="#" class="time">2016-06-23</a></li>
            </ul>
        </div>
    </body>
</html>

css代码如下:

*{
    padding: 0px;
    margin: 0px;
}
.box{
    width:602px;
    height: 292px;
    border: 1px solid #E8E8E8;
    margin: 50px auto;
}
.header{
    width: 560px;
    height: 50px;
    border-bottom: 1px solid #E8E8E8;
    margin: 0px auto;
}
.title{
    width: 100px;
    font-size: 18px;
    font: "微软雅黑";
    color: #000000;
    text-align: center;
    line-height: 50px;
    border-bottom: 1px solid red;
}

ul{
    width: 560px;
    margin-top: 25px;
    margin-left: 21px;
    margin-right: 21px;
    list-style: none;

}
a{
    
    text-decoration: none;
}
li{
    display: block;
    margin-bottom: 15px;
    border-bottom: 1px solid #e8e8e8;
}
.time{
    margin-left: 75px;
}
.dot{
    margin-bottom: 8px;
}

最终运行效果显示:


new.png

相关文章

网友评论

      本文标题:练习题—新闻列表

      本文链接:https://www.haomeiwen.com/subject/faqogftx.html