[英]Top panel position fixed
I want my panel at the top of my page to be fixed. 我希望固定页面顶部的面板。
Here is an example of what I have: http://jsfiddle.net/QuantumHive/pNZx4/ 这是我所拥有的示例: http : //jsfiddle.net/QuantumHive/pNZx4/
If I add position:fixed;
如果我添加
position:fixed;
to the panel, the panel just resizes itself. 面板上,面板只是调整自身大小。 I want the black panel to be full width.
我希望黑色面板为全宽。 It does however scroll with the page.
但是,它会随着页面滚动。 I just don't understand why this is changing the divs entire width.
我只是不明白为什么这会改变divs的整个宽度。
How about adding width: 100%
to the panel? 如何增加
width: 100%
的面板?
With that, you'll also need to add padding-top: 40px
to the #logowrapper to cater for the height of the panel. 这样,您还需要在#logowrapper中添加
padding-top: 40px
以适应面板的高度。
Finally, I added margin: 0; padding: 0
最后,我添加了
margin: 0; padding: 0
margin: 0; padding: 0
to the body to make everything full width of the browser. margin: 0; padding: 0
表示正文,以使浏览器全宽。
http://jsfiddle.net/davidpauljunior/pNZx4/3/ http://jsfiddle.net/davidpauljunior/pNZx4/3/
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.