开发者

What's the trick for fixed positioned elements inside a liquid layout?

开发者 https://www.devze.com 2023-03-17 06:19 出处:网络
开发者_如何学PythonSo I have a fixed positioned element that resides in an expanding element. What\'s the trick to keep it in the same place whether the browser is at 1024px wide or 2000px ?The fixed
开发者_如何学Python

So I have a fixed positioned element that resides in an expanding element.

What's the trick to keep it in the same place whether the browser is at 1024px wide or 2000px ?


The fixed-size element must be display:block, and have a margin:0 auto. To have fixed position, position has to be set via javascript, and updated when the window is resized.

0

精彩评论

暂无评论...
验证码 换一张
取 消