首页 > Web开发 > 详细

css块级元素居中

时间:2016-06-25 12:07:36      阅读:243      评论:0      收藏:0      [点我收藏+]
<!DOCTYPE html>
<html>
<head>
	<title>index</title>
</head>
<body>
	<div class="container">
		<div class="box"></div>
	</div>
	<style type="text/css">
		.container{
			border: 1px solid #000;
			width: 300px;
			height: 200px;
			position: absolute;
		}
		.box{
			border: 1px solid #000;
			width: 50px;
			height: 50px;

			position: absolute;
			margin: auto;
			left: 0;
			right: 0;
			top: 0;
			bottom: 0;

		}
	</style>
</body>
</html>

  

css块级元素居中

原文:http://www.cnblogs.com/jsplyy/p/5615967.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!