text-align下的返回顶部功能实现实例页面
text-align属性作用的不是absolute元素,而是absolute元素之前的文字而已!
CSS代码:
.sina_box{width: 960px; height: 2000px; margin: 0 auto; background: url(images/body_bg.jpg) top center;}
.sina_backtop_box { text-align: right; }
.sina_backtop_h0 { height: 0; overflow: hidden; }
.sina_backtop { width:20px; padding:5px 0; background-color: #DFF3FD; text-align:center; position: fixed; bottom: 100px; }
HTML代码:
<div class="sina_box">
??<div class="sina_backtop_box sina_backtop_h0">
??????? <a href="#" class="sina_backtop">不占据空间</a>
??? </div>
</div>