static, fixed, relative, absolute 를 이용하여 엘리먼트를 화면에 배치하는 것을 조절
p.pos_fixed {
position: fixed;
top: 30px;
right: 5px;
}
h2.pos_top {
position: relative;
top: -50px;
}
h2 {
position: absolute;
left: 100px;
top: 150px;
}
img {
position: absolute;
left: 0px;
top: 0px;
z-index: -1;
}
All CSS Positioning Properties
Property | Description | Values |
---|---|---|
bottom | Sets the bottom margin edge for a positioned box | auto length % inherit |
clip | Clips an absolutely positioned element | shape auto inherit |
cursor | Specifies the type of cursor to be displayed | url auto crosshair default pointer move e-resize ne-resize nw-resize n-resize se-resize sw-resize s-resize w-resize text wait help |
left | Sets the left margin edge for a positioned box | auto length % inherit |
overflow | Specifies what happens if content overflows an element's box | auto hidden scroll visible inherit |
position | Specifies the type of positioning for an element | absolute fixed relative static inherit |
right | Sets the right margin edge for a positioned box | auto length % inherit |
top | Sets the top margin edge for a positioned box | auto length % inherit |
z-index | Sets the stack order of an element | number auto inherit |