CSS 容器高度
我正在努力解决侧边栏的高度。
我的容器现在显示了正确的高度(内部内容的高度),但应该使用该高度 100% 的侧边栏仍然没有出现。
我已经实现了浮动清除(http://www.quirksmode.org/css/clearing.html),但侧边栏仍然没有出现。
我相信这对专业人士来说是一个简单的问题,任何提示都值得赞赏!
谢谢,
汤姆
I'm struggling with a sidebar height.
My container is now showing the correct height (that of the content inside), but my sidebar that should be using 100% of that height is still not appearing.
I've implemented float clearing (http://www.quirksmode.org/css/clearing.html) but the sidebar's still not appearing.
I'm sure this is a simple one for you pros, any tips appreciated!
Thanks,
Tom
Here's my code: http://jsfiddle.net/tomperkins/wy52B/
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
将侧边栏更改为
您还需要将容器更改为
position:relative
。Change the sidebar to
You'll also need to change the container to
position: relative
.或者你可以使用 jQuery:
Or you can use jQuery: