position 中五种位置的区别
CSS中position有static(静态的)、relative(相对的)、absolute(绝对的)、fixed(固定的)、sticky(粘性)。 在这里以box为例来说明其中的区别: HTML: <!DOCTYPE HTML> <html> <head> <body> <h3>注册新用户</h3> <link type="text/css" rel="stylesheet" href="mystyle.css"> <div class="classy">这是div一个特殊类</div> <div class="box" id="one">One</div> <div class="box" id="two">Two</div> <div class="box" id="three">Three</div> <div class="box" id="four">Four</div> </body> </html> CSS: h3 {color: blueviolet; } .classy{ background-color: brown; } .box{ display: inline-block; width: 100px; height: 100px; background: red; color: white; } #two{ position: static; top: