首页 > Web开发 > 详细

记录刷题--web前端

时间:2020-12-25 21:24:26      阅读:38      评论:0      收藏:0      [点我收藏+]

请用 HTML+CSS 实现一个定宽定高元素在容器中的水平和垂直居中。

<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<title></title>
	   <style>
		   *{
			   margin: 0;
			   padding: 0;
		   }
	   </style>
	</head>
	<body>
		<div style="width: 500px; height: 500px; background-color: antiquewhite; position: relative; text-align: center;">
			<div style="width: 200px; height: 200px; background-color: brown;position: absolute; left: 0; top: 0;bottom: 0;right: 0;
			 margin: auto;"></div>
		</div>
	</body>


</html>

技术分享图片

记录刷题--web前端

原文:https://www.cnblogs.com/supretangjiao/p/14190657.html

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