English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

I asked this last night, but only got one answer which didn't really help. I have a horizontal menu navigation bar, and the first item will not line up flush against the left side of the ordered list. Any ideas? Thanks! Here's my code:

#navbar
{
width: 100%;
background: white;
border: 1px dotted;
}

.navbar ul
{
list-style-type:none;
}

.navbar li
{
display: inline;
float: left;
}

2007-12-20 07:09:38 · 5 answers · asked by sunny-d alright! 5 in Computers & Internet Programming & Design

YES! With both of your answers, I was able to do it. Thank you both, so much

2007-12-20 07:32:26 · update #1

5 answers

kinda same as above but i would add "padding:0; margin:0;" to both the UL and the LI this will take care of any padding or margin for both and should eliminate the space

2007-12-20 07:31:24 · answer #1 · answered by Brady 3 · 0 0

You need to zero out the default margins/paddings, and clear your floated li's. You also don't need the display:inline setting on floated elements. Try this:

* {
margin: 0;
padding: 0;
}

#navbar
{
width: 100%;
background: white;
border: 1px dotted;
overflow: auto;
}

#navbar ul
{
list-style-type:none;
}

#navbar li
{
float: left;
}


2007-12-20 07:48:46 · answer #2 · answered by daa 7 · 0 0

Here's what I came up with.



I'm doing the exact same thing at http://throughmylensphotoraphy.com

I would change your CSS .navbar ul and .navbar li to:

#navbar ul and
#navbar li

in #navbar li add this:

margin: 0;
padding: 0;

2007-12-20 07:17:57 · answer #4 · answered by Joshua F 2 · 1 0

supply your ul#nav ul.sub1 sufficient width to hold all your menu products (e.g. width:600px). For IE use conditional comments to comprise CSS for basically the IE version your debugging.

2016-11-23 17:51:36 · answer #5 · answered by schebel 4 · 0 0

fedest.com, questions and answers