js+css实现回到顶部按钮back to top

本文实例介绍了js+css实现回到顶部按钮的方法分享给大家供大家参考,具体内容如下

效果

html

rush:xhtml;">

css

rush:css;"> p#back-to-top{ position:fixed; bottom:100px; right:80px; } p#back-to-top a{ text-align:center; text-decoration:none; color:#d1d1d1; display:block; width:30px; /*使用CSS3中的transition属性跳转链接中的文字添加渐变效果*/ -moz-transition:color1s; -webkit-transition:color1s; -o-transition:color1s; } p#back-to-top a:hover{ color:#979797; } p#back-to-top a span{ background:#d1d1d1 url(../images/arrow_up.png) no-repeat center center; border-radius:6px; display:block; height:30px; width:30px; margin-bottom:5px; /*使用CSS3中的transition属性标签背景颜色添加渐变效果*/ -moz-transition:background1s; -webkit-transition:background1s; -o-transition:background1s; } #back-to-top a:hover span{ background:#979797 url(../images/arrow_up.png) no-repeat center center; }

js

rush:js;">

以上就是本文的全部内容,希望对大家的学习有所帮助。

相关文章

前言 做过web项目开发的人对layer弹层组件肯定不陌生,作为l...
前言 前端表单校验是过滤无效数据、假数据、有毒数据的第一步...
前言 图片上传是web项目常见的需求,我基于之前的博客的代码...
前言 导出Excel文件这个功能,通常都是在后端实现返回前端一...
前言 众所周知,js是单线程的,从上往下,从左往右依次执行,...
前言 项目开发中,我们可能会碰到这样的需求:select标签,禁...