博客列表 >第7章 3_23元素居中_背景_列表与链接-作业

第7章 3_23元素居中_背景_列表与链接-作业

唐朝的博客
唐朝的博客原创
2018年03月27日 15:15:08480浏览

WX20180327-151144@2x.png

实例

<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
	<style type="text/css">
		body{
			display: flex;
			justify-content: space-around;
		}
		hr{
			width: 150px;
			margin-left: 0;
		}
		.box1{
			width: 200px;
			height: 200px;
			background-color: #708090;			
			display: table-cell;
			vertical-align: middle;
		}
		 .box11{
			background-color: #996633;
			width: 100px;
			height: 100px;
			margin: auto; 
			text-align: center;	
		}
		.box11 a{
			line-height: 100px; 
		}
		.box2{
			width: 200px;
			height: 200px;
			background-color: #FC0107;			
			display: table-cell;
			vertical-align: middle;
		}
		.box21{
			text-align: center;
			color: #fff;
		}
		.box3{
			width: 200px;
			height: 200px;
			background-color: #0F80FF;			
			display: table-cell;
			vertical-align: bottom;
			text-align: center;
		}
		
	</style>
</head>
<body >	
	<div>
		<div class="box1">
			<div class="box11"><a >行内元素</a></div>
		</div>
	</div>
	<div>
		<div class="box2">
			<div class="box21"><span>1.文本1</span><br><span>2.文本2</span></div>
		</div>
	</div>
	<div>
		<div class="box3">
			<p>底部文本</p>
		</div>
	</div>
</body>
</html>

运行实例 »

点击 "运行实例" 按钮查看在线实例


声明:本文内容转载自脚本之家,由网友自发贡献,版权归原作者所有,如您发现涉嫌抄袭侵权,请联系admin@php.cn 核实处理。
全部评论
文明上网理性发言,请遵守新闻评论服务协议