![]() |
|
|
|||||||
![]() |
HTML - <ul> formatting problem Mozilla |
|
|
Thread Tools | Search this Thread |
|
|
#1 |
|
Mozilla 1.4 pushes the nav list over with a large false left padding of
some sort: http://www.edgehill.net/html/css/nav.htm Any idea what's going on? It works fine in IE6. I've simplified this to try and track the problem. I boxed the nav menu so you can see how it's out of whack. source: <html> <head> <style> .left { float: left; padding-right: 1em; } ul.menu-left { border: 1px solid #444; list-style: none; width: 1em; } li.menu-left { margin-top: 1em; } li.menu-first-left { } li.menu-last-left { margin-top: 1em; } </style> </head> <body> <center> <table class=".constrained"> <tr> <td class=".constrained"> <div class="left"> <ul class="menu-left"> <li class="menu-first-left"><a href="index.php" >home</a></li> <li class="menu-left"><a href="ecards.php" >ecards</a></li> <li class="menu-last-left"><a href="class-links.php">class links</a></li> </ul> </div> Photo Galleries: <p> pictures<br> travel<br> nature<br> </center> </td> </tr> </table> </body> </html> Paul Furman |
|
|
|
|
#2 |
|
Posts: n/a
|
Paul Furman wrote:
> Mozilla 1.4 pushes the nav list over with a large false left padding of > some sort: > http://www.edgehill.net/html/css/nav.htm > > Any idea what's going on? It works fine in IE6. I've simplified this to > try and track the problem. I boxed the nav menu so you can see how it's > out of whack. > > source: > > <html> > <head> > <style> > .left { > float: left; > padding-right: 1em; > } > ul.menu-left { > border: 1px solid #444; > list-style: none; > width: 1em; width: 1em? haven't copy-pasted it, but could that have to do with it? [snip rest of code] -- Els Sonhos vem. Sonhos vão. O resto é imperfeito. - Renato Russo - |
|
|
|
#3 |
|
Posts: n/a
|
Els wrote:
>> >> source: >> >> <html> >> <head> >> <style> >> .left { >> float: left; >> padding-right: 1em; >> } >> ul.menu-left { >> border: 1px solid #444; >> list-style: none; >> width: 1em; > > > width: 1em? > haven't copy-pasted it, but could that have to do with it? I just did that to emphasize the problem. If I set it to 4 ems or whatever then it fits inside but still has this crazy left margin problem. The box resizes somewhat to hold the menu text. In fact, I can set the width to "0" and it still gives about 3-4 ems with the contents outside that. |
|
|
|
#4 |
|
Posts: n/a
|
Paul Furman wrote: > Els wrote: >> >> width: 1em? >> haven't copy-pasted it, but could that have to do with it? > > > I just did that to emphasize the problem. If I set it to 4 ems or > whatever then it fits inside but still has this crazy left margin > problem. The box resizes somewhat to hold the menu text. In fact, I can > set the width to "0" and it still gives about 3-4 ems with the contents > outside that. IE also moves the list in from the left edge of the page about 4em |
|
|
|
#5 |
|
Posts: n/a
|
Paul Furman wrote:
> Mozilla 1.4 pushes the nav list over with a large false left padding of > some sort: > http://www.edgehill.net/html/css/nav.htm Both ul and li elements have either a default left margin and/or padding, depending on the browser. If you don't want the default values applied, set both margin-left and padding-left to 0. Adjust to taste. -- Reply address is a bottomless spam bucket. Please reply to the group so everyone can share. |
|
|
|
#6 |
|
Posts: n/a
|
kchayka wrote:
> Paul Furman wrote: > > >>Mozilla 1.4 pushes the nav list over with a large false left padding of >>some sort: >>http://www.edgehill.net/html/css/nav.htm > > > Both ul and li elements have either a default left margin and/or > padding, depending on the browser. > > If you don't want the default values applied, set both margin-left and > padding-left to 0. Adjust to taste. I tried margin-left 0; padding-left 0; on everything. The url above now shows a paragraph of text wrapping around the menu (if the window is small) which does not have this big left margin. |
|
|
|
#7 |
|
Posts: n/a
|
Paul Furman wrote:
> Mozilla 1.4 pushes the nav list over with a large false left padding > of some sort: > http://www.edgehill.net/html/css/nav.htm > Its not that mad. Unordered lists are supposed to be indented and Mozilla renders them properly. You can set margins so they don't indent though. -- Sue |
|
|
|
#8 |
|
Posts: n/a
|
Paul Furman wrote:
> I tried > margin-left 0; > padding-left 0; > on everything. Did you try it with colons? Aside: Instructions for fueling a coal fire... if d B mt put : if d B . Translation: If the grate be empty, put coal on. If the grate be full, stop. -- Toby A Inkster BSc (Hons) ARCS Contact Me - http://www.goddamn.co.uk/tobyink/?page=132 |
|
|
|
#9 |
|
Posts: n/a
|
kchayka wrote:
> Paul Furman wrote: > > >>Mozilla 1.4 pushes the nav list over with a large false left padding of >>some sort: >>http://www.edgehill.net/html/css/nav.htm > > > Both ul and li elements have either a default left margin and/or > padding, depending on the browser. > > If you don't want the default values applied, set both margin-left and > padding-left to 0. Adjust to taste. Thanks, I must have done something wrong, looks like it's only needed for the <ul> ul.menu-left { border: 1px solid #444; list-style: none; width: 9em; margin-left: 0; padding-left: 0; } |
|
|
|
#10 |
|
Posts: n/a
|
Paul Furman wrote:
> kchayka wrote: > >> Paul Furman wrote: >> >>> Mozilla 1.4 pushes the nav list over with a large false left padding >>> of some sort: >>> http://www.edgehill.net/html/css/nav.htm >> >> Both ul and li elements have either a default left margin and/or >> padding, depending on the browser. >> >> If you don't want the default values applied, set both margin-left and >> padding-left to 0. Adjust to taste. > > Thanks, I must have done something wrong, looks like it's only needed > for the <ul> > > ul.menu-left { > border: 1px solid #444; > list-style: none; > width: 9em; > margin-left: 0; > padding-left: 0; > } Just a hint: When you need to know where spaces come from, write at the top of the stylesheet *{border:1px solid red; margin:0; padding:0;} See what it looks like then, and see what difference it makes when you take padding:0 away, and then check what happens when you take margin:0 away. Usually works for me -- Els Sonhos vem. Sonhos vão. O resto é imperfeito. - Renato Russo - |
|