日期:2014-03-18  浏览次数:21135 次

CSS部分:

*{
margin:0;
padding:0;
}
* html{
height:100%;
overflow-y:hidden;
}
* html body{
height:100%;
overflow-y:auto;
}
#TargetTOP{
position:fixed;
bottom:10px;
right:10px !important;
right:27px;
border:1px #f00 solid;
}
* html #TargetTOP{
position: absolute;
}

HTML部分:

< a name="Top">< /a>
< div style="border: 1px solid #ff0000; height: 1000px">< /div>
< div id="TargetTOP">< a h ref=" # Top">跳转到页面顶部< /a>< /div>
在FF,ie6,ie7下测试无效,如今发现的缺点是页面中不可以再出现其余带有position属性的元素了.
这些个代码没怎样用,难免有纰漏. 欢迎批评. 代码很简单就不加注释了.
拷贝代码留意下html中空格,实在抱歉,对付编辑器的时间太少.