<!DOCTYPE html> <html> <head> <style> * { margin: 0; padding: 0; } .content { width: 100%; height: 2000px; background-color: gray; } .dw { position: fixed; width: 100px; height: 100px; color: #fff; right: 50px; bottom: 100px; background-color: blueviolet; line-height: 100px; text-align: center; } </style> </head> <body> <div class="content" id="top"> 顶部 <a href="#top"> <div class="dw">回到顶部</div> </a> </div> </body> </html>
原文地址:https://www.cnblogs.com/meiqiyuanzi/p/12286376.html
时间: 2024-11-06 09:39:35