隐藏html5回到顶部,js+css实现回到顶部按钮(backtotop)_javascript技巧

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

效果

html

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

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

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值