欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

盒子模型小练习

程序员文章站 2022-06-01 08:17:22
...

盒子模型小练习

 

 

<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<style type="text/css">
			*{
				margin: 0;
				padding: 0;
				list-style: none;
			}
			img{
				display: block;
			}
			.box{
				width: 238px;
				height: 212px;
				border:1px solid darkgray;
				margin: 100px auto 0;
				border-top: 3px solid #ff8400;
			}
			.box1{
				height: 35px;
				border-bottom: 1px solid darkgray;
				line-height: 35px;
				/*padding-left: 20px;*/
				text-indent: 15px;
			}
			.box1 a{
				color: #333;
				text-decoration: none;
				
			}
			.box2{
				height: 176px;
				/*background: pink;*/
				overflow: hidden;
			}
			.box2_1{
				width: 180px;
				height: 108px;
				/*background: gold;*/
				margin: 10px auto 0;
			}
			.box2_1 a{
				text-decoration: none;
			}
			.box2_1 span{
				display: block;
				color: white;
				font-size: 12px;
				background: black;
				height: 21px;
				line-height: 21px;
				text-align: center;
			}
			.box2_1 a:hover span{
				text-decoration: underline;
				color: gold;
			}
			.list{
				margin-top: 10px;
			}
			.box2 ul a{
				color: #333333;
				text-decoration: none;
				font-size: 12px;
			}
			.box2 ul li{
				text-indent: 21px;
				background: url(img/dian.png) no-repeat 9px center;
				line-height: 20px;
			}
			.box2 ul a:hover{
				color: gold;
				text-decoration: underline;
			}
		</style>
	</head>
	<body>
		<div class="box">
			<div class="box1">
				<a href="##">图片博客</a>
			</div>
			<div class="box2">
				<div class="box2_1">
					<a href="##">
						<img src="img/banner.jpg" />
						<span>厦门螃蟹真好吃</span>
					</a>
				</div>
				<ul class="list">
					<li>
						<a href="##">高考15分爸爸教四岁女儿学数学</a>
					</li>
					<li>
						<a href="##">高考15分爸爸教四岁女儿学数学</a>
					</li>
				</ul>
			</div>
		</div>
	</body>
</html>