187   CSS

1,相对定位,相对于元素所在的初始位置,元素依然占用原来空间

#box_relative {
  position: relative;
  left: 30px;
  top: 20px;
}
ct_css_positioning_relative_example

 

2,绝对定位,相对于元素的父元素定位,元素不占用空间

#box_absolute {
  position: absolute;
  left: 30px;
  top: 20px;
}

 

ct_css_positioning_absolute_example



Leave a Reply

Your email address will not be published. Required fields are marked *