简体   繁体   中英

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/
If I add 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.

How about adding width: 100% to the panel?

With that, you'll also need to add padding-top: 40px to the #logowrapper to cater for the height of the panel.

Finally, I added margin: 0; padding: 0 margin: 0; padding: 0 to the body to make everything full width of the browser.

http://jsfiddle.net/davidpauljunior/pNZx4/3/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM