码迷,mamicode.com
首页 > 其他好文 > 详细

position

时间:2018-09-25 14:05:57      阅读:124      评论:0      收藏:0      [点我收藏+]

标签:abs   spl   pat   lin   static   tle   ble   line   har   

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<link rel="stylesheet" href="./dsmd.css">
<title>Document</title>
</head>
<body>
<div class="box" id="one">One</div>
<div class="box" id="two">Two</div>
<div class="box" id="three">Three</div>
<div class="box" id="four">Four</div>
</body>
</html>
 
 
dsmd.css
.box {
display: inline-block;
width: 100px;
height: 100px;
background: red;
color: white;
}
 
#two {
position: absolute;//探究position中static、absolute、relative、fixed、sticky的区别
top: 20px;
left: 20px;
background: blue;
}
 

position

标签:abs   spl   pat   lin   static   tle   ble   line   har   

原文地址:https://www.cnblogs.com/wxc2/p/9698991.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!