jjalbert
jjalbert

Reputation: 131

How to make a horizontal navbar 100% or size of my wrapper

I am making a navbar and it looks exactly as I want it unless the browser window is made smaller than my page wrapper.

I would like the background color of the navbar to fill the window (i.e. width:100%;) so this div is outside of the page wrapper. The links on the navbar are within the wrapper, however, as the page design is centered. Thus, when the window is smaller than the wrapper, the bkgd of the navbar only extends to the edge of the window, but when you scroll to the right to see the rest of the content the navbar background color ends.

See my fiddle: if your results window is less than 900px the black background on the navbar drops off once you scroll horizontally:

http://jsfiddle.net/jjalbert/Hp7X9/2/

sorry for the long explanation of a simple problem!

Upvotes: 3

Views: 767

Answers (1)

cjc343
cjc343

Reputation: 3765

Sounds like you want a min-width:

http://jsfiddle.net/cjc343/Hp7X9/3/

Upvotes: 1

Related Questions