Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想要一个始终可见的 div 在我的页面右侧。我称之为“#sidebar”。它漂浮在我的页面主体上。问题是当页面没有最大化或者在一些小监视器中浮动的 div 移动了主页(#container)。有什么想法可以解决这个问题吗?谢谢
是的,
删除浮动并添加:
#sidebar{ position:absolute; right:5px;}
如果您以 % 指定侧边栏的宽度,我猜它不会移动您的其余内容,
但是如果你发布你的代码总是更容易,你能发布你的CSS吗?