Go Back   CodingForums.com > :: Client side development > XML

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 05-26-2005, 10:35 PM   PM User | #1
soianyc
New Coder

 
Join Date: Apr 2005
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
soianyc is an unknown quantity at this point
nested <div> and <li>

Ive been making my site xhtml-strict compliant and all checks out. I have a question though about nesting div's and li's

In other words will it be xhtml strict if i do this
Code:
<div>
<ul>
<li>Item One</li>
<li>Item Two</li>
    <div>
    <ul>
    <li>Sub Item of Two</li>
    <li>Sub Item of Two</li>
    </ul>
    </div>
<li>Item Three</li>
</ul>
</div>
soianyc is offline   Reply With Quote
Old 05-26-2005, 11:28 PM   PM User | #2
Basscyst
Smokes a Lot


 
Join Date: Jul 2003
Location: CA, USA
Posts: 1,594
Thanks: 5
Thanked 20 Times in 20 Posts
Basscyst is on a distinguished road
I think that's just fine, but to be sure, you can always run it through a validator.

Basscyst
__________________
Helping to build a bigger box. - Adam Matthews
Basscyst is offline   Reply With Quote
Old 05-27-2005, 02:50 AM   PM User | #3
rmedek
Senior Coder

 
Join Date: Nov 2003
Location: Minneapolis, MN
Posts: 2,879
Thanks: 2
Thanked 65 Times in 56 Posts
rmedek is on a distinguished road
If it needs to be a sub item you're better off doing this:
Code:
<div>
   <ul>
      <li>Item One</li>
      <li>Item Two
         <ul>
            <li>Sub Item of Two</li>
            <li>Sub Item of Two</li>
         </ul>
      </li>
      <li>Item Three</li>
   </ul>
</div>
__________________
drums | web
rmedek is offline   Reply With Quote
Old 05-27-2005, 09:23 AM   PM User | #4
JamieR
Senior Coder

 
JamieR's Avatar
 
Join Date: Oct 2004
Location: United Kingdom
Posts: 3,161
Thanks: 0
Thanked 5 Times in 5 Posts
JamieR is on a distinguished road
Quote:
Originally Posted by Basscyst
I think that's just fine, but to be sure, you can always run it through a validator.

Basscyst
Nope that code would have produced an error - www.jamierees.co.uk/correct.php
__________________
-Jamie
JamieR is offline   Reply With Quote
Old 05-27-2005, 12:15 PM   PM User | #5
dannyhayes
Regular Coder

 
Join Date: Jan 2005
Location: Essex
Posts: 146
Thanks: 0
Thanked 0 Times in 0 Posts
dannyhayes is an unknown quantity at this point
Jamie what good did that do!
__________________
Danny Hayes
Under Construction www.hayes-design.co.uk
dannyhayes is offline   Reply With Quote
Old 05-27-2005, 02:50 PM   PM User | #6
gsnedders
Senior Coder

 
gsnedders's Avatar
 
Join Date: Jan 2004
Posts: 2,340
Thanks: 1
Thanked 7 Times in 7 Posts
gsnedders will become famous soon enough
Quote:
Originally Posted by dannyhayes
Jamie what good did that do!
Prove that it fails validation.

Only one element can be the direct descendent of <ul>/<ol> - <li>.
__________________
Geoffrey Sneddon
gsnedders is offline   Reply With Quote
Old 05-27-2005, 09:51 PM   PM User | #7
Basscyst
Smokes a Lot


 
Join Date: Jul 2003
Location: CA, USA
Posts: 1,594
Thanks: 5
Thanked 20 Times in 20 Posts
Basscyst is on a distinguished road
I stand corrected. I didn't test it, my main point was that simply validating the page will resolve any doubt.

Basscyst
__________________
Helping to build a bigger box. - Adam Matthews
Basscyst is offline   Reply With Quote
Old 06-07-2005, 04:24 PM   PM User | #8
soianyc
New Coder

 
Join Date: Apr 2005
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
soianyc is an unknown quantity at this point
It did fail for me also. I guess ill have to do it the right way. no sense in having one page not validate if all the rest do. thanks for your replies
soianyc is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

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

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

Forum Jump


All times are GMT +1. The time now is 02:01 AM.


Advertisement
Log in to turn off these ads.