I am using a Navigation design from the site – CSSDECK.
I have done some modification and this is my code.
DOUBTS:
- Why
#siteNavand#siteNav ulnot wrapping aroundlis. I have usedheight:autoin#siteNavand#siteNav ul. What I know isautomeans browser will decide the height accordingly. But this isn’t happening. WHY? - If I do
overflow:auto or hiddenin any of#siteNavor#siteNav ul. Then that block wrap itself around thelis. Why usingoverflowdoing this?
This is because your
lis are floated. When you don’t haveoverflow: hidden;, then thelis are in a different context than theul, so theuldoesn’t wrap around them.overflow: hidden;is a generic, known fix for containers to resize to fit theirfloated contents, but there are other methods — for an extensive reference, see this.