网易新闻原网站:
效果图:
源码:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>网易新闻右侧列表</title>
<link rel="stylesheet" href="./css/reset.css">
<style>
body{ /*设置网页背景,方便修改观察制作情况*/
background-color: wheat;
}
.div-item{ /* 将整个新闻栏放入一个块内 */
width: 300px;
height: 324px;
margin-top: 27px;
background-color: rgb(252, 250, 250);
margin: 50px auto;
}
.div-item a{ /* 取出超链接的下划线 */
text-decoration: none;
}
.div-item .div1{
width: 300px;
height: 41px;
border-top: 1px #dddddd solid;
}
.div-item .div2{
width: 300px;
height: 150px;
}
.div-item .ul1{
width: 300px;
height: 120px;
margin-top: 12px;
}
.div-item .h21{ /* 对“体育”标题的设置 */
width: 32px;
height: 3px;
margin-top: -1px;
padding-top: 11px;
padding-bottom: 10px;
border-top: 1px tomato solid;
}
.div-item .h21 a{
color: black;
font-size: 16px;
font-weight: bold;
}
.div-item .div21{
width: 300px;
height: 40px;
/* margin-left: 38px; */
margin-top: -24px;
}
.div-item .h31{ /* 图片新闻文字效果 */
width: 300px;
height: 40px;
font-size: 17px;
color: white;
font-family:'微软雅黑';
font-weight: bold;
margin-left: 30px;
}
.div-item li{ /* 下方新闻列表 */
width: 285px;
height: 30px;
padding-left: 4px;
}
.div-item li a{ /* 对下方新闻列表的设置 */
color: rgb(111, 113, 114);
font-size: 14px;
padding-left: 2px;
}
.div-item a:hover{ /* 当鼠标移入新闻条时触发的效果 */
color: rgb(252, 62, 62);
}
.div-item li::before{ /* 项目符号 */
content: '■';
color: rgb(230, 230, 230);
font-size: 4px;
}
</style>
</head>
<body>
<div class="div-item">
<div class="div1">
<h2 class="h21">
<a href="">体育</a>
</h2>
</div>
<div class="div2">
<a href="">
<img src="./img/03/1.jpeg" alt="">
<div class="div21">
<h3 class="h31">孙铭徽失绝杀!广夏1分惜败吉林</h3>
</div>
</a>
</div>
<ul class="ul1">
<li>
<a href="">当年的香港飞龙队,CBA史上第一奇葩</a>
</li>
<li>
<a href="">406天没扣篮!格里芬成三分"工具人"</a>
</li>
<li>
<a href="">1.95亿到手!爵士基石彻底放飞 玩命学哈登</a>
</li>
<li>
<a href="">颜丙涛堪称翻版塞尔比 为了胜利"不择手段"</a>
</li>
</ul>
</div>
</body>
</html>
积跬步,至千里!
加油!上学人!