梦想家们

关注

绝对定位居中布局

梦想家们

关注

阅读 181

2022-09-09

<!DOCTYPE html>
<html>

<head>
<meta charset="UTF-8">
<title></title>
<style type="text/css">
html,
body {
height: 100%;
}

.div {
position: absolute;
/*height: 200px;*/
width: 800px;
background: yellow;
margin: 0 auto;
top: 0;
left: 0;
bottom: 0;
right: 0;
/*margin-top: -100px;*/
}
</style>
</head>

<body>
<div class="div"></div>
</body>

</html>

 



相关推荐

杰森wang

html div绝对定位居中

杰森wang 180 0 0

老牛走世界

CSS 定位布局 - 绝对、固定定位设置居中悬浮div

老牛走世界 103 0 0

晚熟的猫

绝对定位水平垂直居中

晚熟的猫 78 0 0

三次方

绝对定位的盒子居中算法

三次方 143 0 0

北邮郭大宝

【CSS】轮播图案例开发 ( 基本设置 | 子绝父相 | 浏览器水平居中 | 圆角设置 | 绝对定位居中设置 )

北邮郭大宝 110 0 0

大漠雪关山月

相对定位与绝对定位如何让页面样式居中的?

大漠雪关山月 83 0 0

香小蕉

定位(绝对定位)

香小蕉 123 0 0

金穗_ec4b

CSS绝对定位元素居中的几种方法

金穗_ec4b 206 0 0

伽马星系

低代码设计器的栅格布局和绝对定位布局对比

伽马星系 43 0 0

新鲜小饼干

相对定位绝对定位

新鲜小饼干 77 0 0

精彩评论(0)

0 0 举报