绝对定位的元素(输入)放置在显示器底部,无机身。
如果我在身体上添加相对位置,请在身体底部输入位置!
为什么?

<body>

     <input type="button" value="click" style="position:absolute;bottom:0;" />

     <div style="height:500px;background-color:red;"></div>
     <div style="height:500px;background-color:blue;"></div>
     <div style="height:500px;background-color:green;"></div>
     <div style="height:500px;background-color:yellow;"></div>
     <div style="height:500px;background-color:pink;"></div>

</body>

最佳答案

为了使子元素绝对位于其父元素的位置,我们需要在父元素本身上进行设置

https://css-tricks.com/almanac/properties/p/position/

关于html - 绝对定位元素,没有定位祖先,没有监视器设置自身,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/44179831/

10-12 00:21
查看更多