position: relative;
top: 200px;
from the top push 200px
push就是推的意思,原来的样子再从上向下推200px的距离
css:
body {
margin: 0;
}
.box {
width: 400px;
height: 400px;
margin: auto;
background-color: red;
position: relative;
top: 200px;
}
position: absolute;
left: 20px;
top: 30px;
within it`s nearest parent
from it`s parent left 20px top 30px
body {
margin: 0;
}
.box {
width: 400px;
height: 400px;
margin: auto;
background-color: red;
position: absolute; within it`s nearest parent
left: 20px;
top: 30px;
}
absolute找最近的relative父容器:
body {
margin: 0;
}
.wrap {
width: 800px;
height: 1000px;
margin: auto;
position: relative;
background-color: #e3e3e3;
}
.box {
width: 400px;
height: 400px;
margin: auto;
background-color: red;
position: absolute;
left: 20px;
top: 30px;
}
如果.wrap不是relative的,那么最近的父容器就是body
分享到:
相关推荐
在使用seek()函数时,有时候会报错为 “io.UnsupportedOperation: can’t do nonzero cur-relative seeks”,如下: with open('C:/Users/Desktop/xian.txt', 'r') as filename: print(filename.read()) print...
Structure Extraction from Texture via Relative Total Variation 论文,代码,测试图像和ppt
Single Image Layer Separation using Relative Smoothness
Relative-Orientation,摄影测量中的相对定向程序,是大学时期的重要程序。仅供参考。
The Relative Sophistication of Chinese Exports.pdf
Rich-Cheap and Relative Value Trading.pdf
对position的属性relative和absolute的总结
Fixed Income & Relative-Value Strategy.pdf
异常检测 异常检测 异常检测 Improving iForest with Relative Mass.
Relative_Wear_Relativewear_jobvfw_closelyxl5_EDEM磨损模型_EDEM.zip
Relative perturbation bounds for generalized nonnegative and positive polar factors,李寒宇,Hu Yang,The changes in the generalized nonnegative and positive polar factors of weighted polar ...
Relative_Wear_Relativewear_jobvfw_closelyxl5_EDEM磨损模型_EDEM_源码.rar
The main point of Relative Vigor Index Indicator (RVI) is that on the bull market the closing price
Procedures for calculating Relative wavelet energy
Japanese relative clause constructions (RCC’s) are defined as being the NP’s of structure ‘S NP’, noting the lack of a relative pronoun or any other explicit form of noun-clause demarcation. ...
calculate relative location between sea above object and airplane
This article is an research for Wireless Sensor Networks about location/position estimation. The main method is TOA (Time of Arrival) using the parameter RSSI (Received Signal Strength Indication). ...
EDEM磨损模型,用于计算几何体受到的磨损力
500 bytes ) 使用本机浏览器API安装: 从使用/从此下载/ npm i @yaireo/relative-time -S用法: 通过JS导入CSS文件import RelativeTime from '@yaireo/relative-Time' 并使用const relativeTime = new Relative...
计算机视觉大牛论文!当前最火的视觉研究方向之一