感谢您的支持,我会继续努力的!
打开微信扫一扫,即可进行扫码打赏哦
点我查看本站打赏源码!
Powered by RUNCODEX.COM,学的不仅是技术,更是梦想!!!
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>文档标题</title>
</head>
<body>
<h1>position 属性</h1>
<div class="border static">1. 静态定位的Div</div>
<br/>
<div class="border relative1">2. 相对定位但未设置额外属性的Div</div>
<div class="border relative2">3. 相对定位且设置额外属性的Div</div>
<div class="border relative">
<div class="border absolute">4. 绝对定位的Div</div>
</div>
<div class="border fixed">5. 固定定位的Div</div>
</body>
</html>
输入 JavaScript 代码……
xxxxxxxxxx
.border{
border: solid red;
}
.static {
position: static;
.relative1 {
position: relative;
.relative2 {
top: -30px;
left: 30px;
background-color: white;
width: 500px;
.relative {
width: 600px;
height: 400px;
.absolute {
position: absolute;
top: 120px;
right: 0;
width: 300px;
height: 200px;
.fixed {
position: fixed;
bottom: 0;
width: 200px;