<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<style>
html,
body{
height: 100%;
margin: 0;
padding: 0;
}
.centerDIV{
width: 650px;
height: 500px;
background-color: #4da6ff;
position: absolute;
left: 50%; top: 50%;
transform: translate(-50%,-50%);
}
</style>
</head>
<body>
<div class="centerDIV"></div>
</body>
</html>
div根据屏幕居中,位于屏幕中间
最新推荐文章于 2022-07-17 18:05:48 发布