HighDots Forums  

Problem aligning list items in IE

Cascading Style Sheets Layout/presentation on the WWW (comp.infosystems.www.authoring.stylesheets)


Discuss Problem aligning list items in IE in the Cascading Style Sheets forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Chris
 
Posts: n/a

Default Problem aligning list items in IE - 05-05-2005 , 05:28 AM






Hello,

I have an unordered list with 3 levels, like this:
<ul class="normalList">
<li>blabla</li>
<ul>
<li>blabla</li>
</ul>
<li>blabla</li>
<ul>
<li>blabla</li>
<ul>
<li>blabla (shifted to the right)</li>
<li>blabla</li>
<li>blabla</li>
<li>blabla</li>
<li>blabla</li>
</ul>
</ul>
</ul>

The problem I have in IE 6 and 5 is that the list items of the third
level do not horizontally align with each other (the first item is
shifted to the right). It works fine in Firefox.

My CSS is this:

ul.normalList li {
margin: 1em;
padding: 0;
}

Can you help me?

Thank you

Chris

Reply With Quote
  #2  
Old   
Beauregard T. Shagnasty
 
Posts: n/a

Default Re: Problem aligning list items in IE - 05-05-2005 , 09:02 AM






Chris wrote:

Quote:
Hello,
G'morning.

Quote:
I have an unordered list with 3 levels, like this:
ul class="normalList"
li>blabla</li
ul
li>blabla</li
/ul
Whoa. The only thing allowed as a direct child of a <ul> is one or
more <li>. Your inner <ul>'s need to be *within* an <li>.

<li>blabla</li>
<li>
<ul>
<li>blabla</li>
</ul>
</li> ...

--
-bts
-This space intentionally left blank.


Reply With Quote
  #3  
Old   
Chris
 
Posts: n/a

Default Re: Problem aligning list items in IE - 05-05-2005 , 10:03 AM





Beauregard T. Shagnasty wrote:
Quote:
Chris wrote:

Hello,


G'morning.

I have an unordered list with 3 levels, like this:
ul class="normalList"
li>blabla</li
ul
li>blabla</li
/ul


Whoa. The only thing allowed as a direct child of a <ul> is one or more
li>. Your inner <ul>'s need to be *within* an <li>.

li>blabla</li
li
ul
li>blabla</li
/ul
/li> ...

Sorry to contradict you but no. Your syntax would create additional
bullets. You could write this:

<ul class="normalList">
<li>blabla
<ul>
<li>blabla</li>
</ul>
</li>

But this would not solve my problem: there is still a shift to the
right of the first list item.


Reply With Quote
  #4  
Old   
Beauregard T. Shagnasty
 
Posts: n/a

Default Re: Problem aligning list items in IE - 05-05-2005 , 10:54 AM



Chris wrote:
Quote:
Beauregard T. Shagnasty wrote:
Whoa. The only thing allowed as a direct child of a <ul> is one or
more <li>. Your inner <ul>'s need to be *within* an <li>.

li>blabla</li
li
ul
li>blabla</li
/ul
/li> ...

Sorry to contradict you but no. Your syntax would create additional
bullets.
But no? Stuff can be outside of a <li></li>? 'Fraid not.

Quote:
You could write this:

ul class="normalList"
li>blabla
ul
li>blabla</li
/ul
/li
Yes, you could do that and not have an extra bullet. But, you have now
enclosed the child <ul> within the outer <li> which is what I was
commenting on that you were doing wrong.

Quote:
But this would not solve my problem: there is still a shift to the
right of the first list item.
Provide a sample URL.

--
-bts
-This space intentionally left blank.


Reply With Quote
  #5  
Old   
Chris
 
Posts: n/a

Default Re: Problem aligning list items in IE - 05-05-2005 , 11:57 AM



Beauregard T. Shagnasty wrote:
Quote:
Provide a sample URL.

Here it is: http://ivredimages.free.fr/produits.php

See the page with IE6 or IE5.x

Thank you


Reply With Quote
  #6  
Old   
Beauregard T. Shagnasty
 
Posts: n/a

Default Re: Problem aligning list items in IE - 05-05-2005 , 12:07 PM



Chris wrote:
Quote:
Here it is: http://ivredimages.free.fr/produits.php

See the page with IE6 or IE5.x
Win2K, IE6 and Firefox 1.0.3 look pretty much the same to me. Did your
original effort have the nested <ul> outside of an <li>?

Asides:
1. <title>Untitled Document</title>
2. It won't fit in my 800px wide browser window without horizontal
scrollbar.
Otherwise, looks good.

--
-bts
-This space intentionally left blank.


Reply With Quote
  #7  
Old   
Jim Moe
 
Posts: n/a

Default Re: Problem aligning list items in IE - 05-05-2005 , 01:30 PM



Chris wrote:
Quote:
Sorry to contradict you but no. Your syntax would create additional
bullets. You could write this:

ul class="normalList"
li>blabla
ul
li>blabla</li
/ul
/li

The only difference between yours and Beauregard's is that you have
text for the <li>.

Quote:
But this would not solve my problem: there is still a shift to the
right of the first list item.
Did you try it with the correct syntax?
This goes a *lot* faster if you provide an URL demonstrating the problem.

--
jmm dash list (at) sohnen-moe (dot) com
(Remove .AXSPAMGN for email)


Reply With Quote
  #8  
Old   
Harlan Messinger
 
Posts: n/a

Default Re: Problem aligning list items in IE - 05-05-2005 , 01:56 PM



Beauregard T. Shagnasty wrote:
Quote:
Chris wrote:


Beauregard T. Shagnasty wrote:

Whoa. The only thing allowed as a direct child of a <ul> is one or
more <li>. Your inner <ul>'s need to be *within* an <li>.

li>blabla</li
li
ul
li>blabla</li
/ul
/li> ...


Sorry to contradict you but no. Your syntax would create additional
bullets.


But no? Stuff can be outside of a <li></li>? 'Fraid not.
I think the point is that that's not the way a nested list works. He wants

* Level 1
* Level 2
* Level 2
* Level 1
* Level 1

Your way gives

* Level 1
* *Level 2
*Level 2
* Level 1
* Level 1

or something like that.


Quote:
You could write this:

ul class="normalList"
li>blabla
ul
li>blabla</li
/ul
/li


Yes, you could do that and not have an extra bullet. But, you have now
enclosed the child <ul> within the outer <li> which is what I was
commenting on that you were doing wrong.
No, you were commenting that he can't have child UL inside parent UL,
which is correct. This is child UL inside parent LI, which is perfectly
good HTML (though I would then also put the "blabla" right after the
<li> tag into its own explicit block; otherwise, the UA will wrap it in
an anonymous one).

Quote:
But this would not solve my problem: there is still a shift to the
right of the first list item.

Provide a sample URL.
Yes, please, I'm likewise not seeing why this would happen. I use this
approach all the time.



Reply With Quote
  #9  
Old   
Chris
 
Posts: n/a

Default Re: Problem aligning list items in IE - 05-05-2005 , 02:02 PM





Beauregard T. Shagnasty wrote:
Quote:
Chris wrote:

Here it is: http://ivredimages.free.fr/produits.php

See the page with IE6 or IE5.x


Win2K, IE6 and Firefox 1.0.3 look pretty much the same to me. Did your
original effort have the nested <ul> outside of an <li>?
For me, it is okay under Firefox. But under IE, the first line item is
shifted to the right a few pixels. The <ul> are nested inside <li> in
this page.
Quote:
Asides:
1. <title>Untitled Document</title
Yes I know but this page is just an attempt to find the right design.
There are still a few things I do not quite like.
Quote:
2. It won't fit in my 800px wide browser window without horizontal
scrollbar.
The width of this design is 800px. I should make it a bit smaller then.

Thank you for your remarks.


Reply With Quote
  #10  
Old   
Beauregard T. Shagnasty
 
Posts: n/a

Default Re: Problem aligning list items in IE - 05-05-2005 , 02:03 PM



Harlan Messinger wrote:
Quote:
No, you were commenting that he can't have child UL inside parent
UL, which is correct. This is child UL inside parent LI, which is
perfectly good HTML
...except that in his first post, the child UL was not inside an <li>.
Easy to miss that at a glance.

Quote:
(though I would then also put the "blabla" right after the <li> tag
into its own explicit block; otherwise, the UA will wrap it in an
anonymous one).
So would I. <g> My point was to show that UL needs to be inside LI.

Quote:
Provide a sample URL.

Yes, please, I'm likewise not seeing why this would happen. I use
this approach all the time.
Did you see his sample page? It appears to be (now) correctly written.
(though it has a couple of other unrelated errors.)

--
-bts
-This space intentionally left blank.


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.