<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<style type="text/css">
* { /*清空默认的内外边距 几乎是我们写css必须要写的 */
margin: 0;
padding: 0;
}
ul {
list-style: none; /*取消列表自带的小点 默认的列表样式*/
}
.searchpic {
width: 238px;
height: 294px;
border: 1px solid #d9e0ee;
border-top: 3px solid #ff8400; /* 代码从上往下依次执行 所以这句话要放在border的下面*/
margin: 100px;
}
.searchpic h3 {
height: 35px;
line-height: 35px; /*让行高等于高度,可以让文字垂直居中*/
border-bottom: 1px solid #d9e0ee;
font-size: 16px;
font-weight: normal; /*让粗体不变粗*/
padding-left: 12px; /*因为这个h3没有给宽度,继承父亲的宽度padd就不会撑开盒子了*/
}
.searchpic img {
margin: 7px 0 0 8px; /*上右下左*/
}
.searchpic ul li a {
font-size: 12px;
color: #666;
text-decoration: none; /* 取消下划线*/
}
.searchpic ul {
margin-left: 8px;
}
.searchpic ul li {
padding-left: 10px;
height: 26px;
line-height: 26px;
background: url(1.png) no-repeat left center; /*背景设置*/ /*水平 垂直*/
}
.searchpic ul li a:hover {
text-decoration: underline; /*添加下划线*/
color: #ff8400;
}
</style>
</head>
<body>
<div class="searchpic">
<h3>搜索趣图</h3>
<img src="1.jpg" height="160" width="218" alt="">
<ul>
<li><a href="#">魔兽世界新图</a></li>
<li><a href="#">魔兽世界新图</a></li>
<li><a href="#">魔兽世界新图</a></li>
</ul>
</div>
</body>
</html>
盒子案例
最新推荐文章于 2024-03-10 22:45:15 发布