a标签 CSS实现回顶部

.go-top{position:fixed;bottom:30px;right:30px;z-index:1000;width:48px;height:48px;display:inline-block;text-align:center;background:#fff;border-radius:6px}

position:fixed 位于浏览器固定位置 且置于上层

.go-top a{display:block}
.go-top a svg{width:30px;height:30px;margin-top:10px;fill:#999} ---加svg图标
.go-top a:hover svg{fill:var(--main-color)}
<div><a href="#top">顶部</a></div>

©️李联华的博客网 当前IP地址:18.218.236.85,归属地:俄亥俄州Dublin ,欢迎您的访问!

温馨提示 : 非特殊注明,否则均为李联华的博客原创文章,本站文章未经授权禁止任何形式转载
文章链接:https://www.ooize.com/a-tag-css-implementation-back-to-the-top.html
订阅
提醒
guest
0 评论
内联反馈
查看所有评论
Loading...