所以,这是一个小问题,可能有一个简单的解决方法,但我的大脑显然想不出来。
HTML:
#div {
position: fixed;
top: 10%;
left: 20%;
right: 20%;
bottom: 10%;
z-index: 999;
text-align: center;
border-radius: 10px;
}
<div id="div">
<h1>Settings</h1>
<center>
<img src="https://istack.dev59.com/yOhGp.webp" style="width: 30px; margin-bottom: -8px;"><br/>
<button style="float: bottom; position: absolute; bottom: 10px;">Hide</button>
</center>
</div>
显然,按钮被卡在了屏幕右侧。但是,我想让它像顶部图片一样处于屏幕中央。谢谢 :)