.wrap { height:2000px; } .red { background:red; height:600px; } .green { background:green; height:600px; } .yellow { background:yellow; height:800px; } #back-top { position:fixed; width:60px; height:60px; bottom:30px; right:30px; background:#ccc; text-align:center; line-height:60px; text-decoration:none; }
当页面滚动到指定位置时,出现返回顶部