Joel 0

The navigation text in the attached web page has fallen outside of its parent container, how can I fix it?

  • i would like the "search" text in the nav to float in the right, how can i make it? Joel about 10 years ago
  • Joel about 10 years ago

4 answers

u62 5

All the contents of your div are floated You need to either put some html in there that isn't floated and apply the 'clear' CSS property to it, or use a self-clearing technique (google for "css self-clearing").

Answered about 10 years ago by u62
danwellman 5600

It's most likely because the floated list items aren't being cleared. Try adding a clearing div after the <ul>:

<div class="clear"><!-- --></div>

Then have the css:

.clear { clear:both; }

You may need a little negative margin-top on the <ul> too to pull it up into place

Answered about 10 years ago by danwellman

all your list items are floated left and your links are inline, and that's what happens....

best to swap float:left with display: inline to get a horizontal menu from an unordered list and add some margin to the links

Answered about 10 years ago by Tony Crockford
Joel 0

i just added:

header #nav ul{

margin: 0;

and it cleared, check it out

Answered about 10 years ago by Joel
  • @Joel Please use comments for replies to answers and other comments, thanks! Matthew Brindley about 10 years ago