迟疑的节奏

导航

css3-实现水平垂直居中

<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>实现水平垂直居中</title>
	<style type="text/css">
         .content {
         	width: 100px;
         	height: 100px;
         	background: yellow;
         	position: absolute;
         	top: 50%;
         	left: 50%;
         	border-radius: 5px;
         	transform: translate(-50%,-50%);
         }

	</style>
</head>
<body>
	<div class="content"></div>
</body>
</html>

  

posted on 2020-02-20 21:14  迟疑的节奏  阅读(197)  评论(0编辑  收藏  举报