<!DOCTYPE html><head><meta charset="utf-8" />
<!-- set screen 3000px big to show it functions, and buttons don't play well with center so set the button left offset (will need adjust for a given screen width and font size -->
<style>
a:-webkit-any-link { color: black ; text-decoration: none; font-size: 20px;}
body { height: 3000px ; background-color: #2a3a1f ; color: #fef1f0; font-family: Helvetica, sans-serif; text-align: center;}
button { Left: 300px ; position: fixed; top: 0 ; text-decoration: none; }
</style></head><body>
<button type="button"><a href="#top">Please scroll down for more details, and touch here to return to "Top of Page"</a></button>
<br><h1>Hello Browser, Welcome to the Small Museum</h1>
<div>
Here be many interesting Art & Facts to explore, especially below.
</div>
</body></html>
1条答案
按热度按时间xggvc2p61#
我会建议按钮被“粘”到顶部的看法,因为更直观的后藤边缘。您可以通过替换我设置的Top 0来使用屏幕底部