html - html - CSS percentage widths out of document width? - answerstu - answerstu

html - CSS percentage widths out of document width?

I set a min-width of 1000px on a website I've been working on. In the header, the (floated) links each have a percentage width (25%), and the <nav> has a full width (100%).

Right now, when the window is too small, the header and navigation bar gets cut off at the 100% window width (it doesn't expand over to the overflow area).

Is there any way (with just CSS) for the header to expand to the full document width (not the window width), and then the links to resize accordingly? Thanks.

1 Answer

  1. Chris- Reply


    You need to wrap all the data (like: header,#container,footer) inside of wrapper div <div id="wrapper"></div>, remove padding-top property from the body and use below mentioned css

    #wrapper{padding-top: 150px;position: relative;}

Leave a Reply

Your email address will not be published. Required fields are marked *

You can use these HTML tags and attributes <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>