nav bar wrapping on smaller resolutions

后端 未结 3 2039
醉梦人生
醉梦人生 2021-02-15 11:39

I\'m trying my hand at HTML5/CSS3 as a learning process but I\'m struggling to create a navigation bar for links to other sections across my pages. I adapted the code from a tut

3条回答
  •  萌比男神i
    2021-02-15 12:26

    The problem is you are setting the nav width to be a mere 33.3% with the rest being padding. The small allowable space is then pushing all the elements underneath each other when resized past a certain point. To stop this from happening you can do two things, set the nav width to be 100% instead, and second, if you don't want it to resize at all then you have to give it a min-width of the sum of all the a elements' widths put together. You should also most likely give it a max-width as well unless you are using a responsive design. Here's a demo I put together with your modified css: http://jsfiddle.net/c3HE6/

提交回复
热议问题