Blogger Information
Blog 42
fans 0
comment 0
visits 15676
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
0711绝对定位/相对定位/固定定位
小言
Original
281 people have browsed it

演示案例

  1. <div class="box">
  2. <div class="one">我是第一层</div>
  3. <div class="two">我是第二层</div>
  4. <div class="three">我是第三层</div>
  5. </div>

相对定位

  1. .box .one{
  2. height: 50px;
  3. width: 500px;
  4. background-color: aqua;
  5. position: relative;
  6. top:20px;
  7. left: 50px;
  8. }

绝对定位

  1. .box .two{
  2. height: 50px;
  3. background-color:chartreuse;
  4. position:absolute;
  5. top: 50px;
  6. left: 30px;
  7. }

固定定位

  1. .box .three{
  2. height: 50px;
  3. background-color:burlywood;
  4. position: fixed;
  5. top:100px;
  6. left: 50px;

Correcting teacher:PHPzPHPz

Correction status:qualified

Teacher's comments:
Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post