A Conversation for Website Developer's Forum
CSS and XHTML
Nireena Started conversation Oct 4, 2002
H'lo all. Thought I'd tap your collective wisdom for this one:
I'm trying to convert my pages from HTML 4.1 to XHTML 1.0 and get them to validate according to the W3C's tool. For some reason, the validator doesn't like lists-within-a-list, even though the lists show up properly in the browser (for example, squares for the outer list and hollow circles for the inner list). Is there something I need to fix in my style sheet or in my page so that it both validates and displays correctly?
My page looks like this:
list one item one
list one item two
list two item one
list two item two
list one item three
And my style sheet looks like this:
UL
{blah;}
UL UL
{more blah;}
Thanks,
CSS and XHTML
Ion the Naysayer Posted Oct 4, 2002
Heh... You picked an easy one; Obscure, but easy.
Instead of:
This is a first level item
This is a second level item
use:
This is a first level item
This is a second level item
That is, every list has to be the child of a previous list item (li), not of a previous list (ul/ol).
CSS and XHTML
HappyDude Posted Oct 4, 2002
you might find http://alistapart.com/stories/taminglists/ of use
CSS and XHTML
Ion the Naysayer Posted Oct 4, 2002
And just for the record I think it's counter-intuitive and a little silly so I'm going to look up the reasoning behind why they made the decision that way on the W3C www-html mailing list archives and if it still doesn't make sense to me I'm going to bring it up on the list.
Anyway, if you want to see a page as an example, look at [Broken link removed by Moderator]. Heh... and you can see the comments my prof wrote on my group's assignment if you care to...
CSS and XHTML
Ion the Naysayer Posted Oct 4, 2002
Stupid period...
That link should read:
http://society2x03.dhs.org/groupfiles/07/cqafrs.html
CSS and XHTML
Nireena Posted Oct 4, 2002
Ion: Thanks! I agree, that is counter-intuitive. I'd be very curious to find out why they chose to do it that way. The link was useful, by the way.
HappyDude: Thanks. I'll have to bookmark that link, lots of good info there.
*microwave dings*
We should get a ramen icon. The closest I can think of is since I cook my ramen in a big latte mug.
CSS and XHTML
dElaphant (and Zeppo his dog (and Gummo, Zeppos dog)) - Left my apostrophes at the BBC Posted Oct 4, 2002
It makes perfect sense to me that every item in a list be a list item, even if it is another nested list. Would it make sense if everything in a list had to a list item *except* for nested lists? What would that do to the box model and the DOM?
CSS and XHTML
DoctorMO (Keeper of the Computer, Guru, Community Artist) Posted Oct 4, 2002
It the same with tables,
you can only inbed a table in a TD not TR (unless you want it to apear at the top with some horible efects in mozzila) makes sense to me too.
-- DoctorMO --
CSS and XHTML
Nireena Posted Oct 4, 2002
I've never dealt with tables-within-tables so I didn't know that it works the same with those.
It still seems odd to me. The list is within the first list, not within a particular item, so it made sense to me to finish the item you were dealing with first before starting the second list.
Ah well. At least it looks how I want it to now.
CSS and XHTML
DoctorMO (Keeper of the Computer, Guru, Community Artist) Posted Oct 4, 2002
But the list is suposed to be with in an item i.e
Meat
Fruit
Apples
Pears
Oranges
Bread
The second list in this example is Fruit
-- DoctorMO
CSS and XHTML
Nireena Posted Oct 4, 2002
*shrug* I guess. I'll do it however it needs to be done to get it to look the way I want it to, but I still wouldn't have set it up that.
Just out of curiosity- how do they decide who gets to be on the W3C committee and make decisions like that, anyway? Are they voted in? Do they volunteer?
CSS and XHTML
Ion the Naysayer Posted Oct 4, 2002
For me, having lists embedded into list items is like writing:
Heading 1
Here is the accompanying text to go with this heading
When I think of sublists, generally it makes more sense to me to treat them like:
First List
First item
Second item
Second List
First item
Second item
where the list items are headings and the lists are not part of a list item.
With regards to the box model it makes more sense the other way but the average person doesn't care about the box model.
Tables are an entirely different case because a table row is only a container. It intuitively makes sense that you can only put table data in a table data element.
Personally I don't think of a list as a container, where I do think of a table as one. I think most people think the same way, judging from the number of times this exact issue has come up on the www-validator mailing list
CSS and XHTML
dElaphant (and Zeppo his dog (and Gummo, Zeppos dog)) - Left my apostrophes at the BBC Posted Oct 4, 2002
h1 and p are not containers, which is why you can't have a inside an , not to mention that they are two different types of data and are mutually exclusive.
Of course a list is a container. You can't have a list with nothing in it. It must contain *something*.
In fact, I think it's your example that is confusing. If you think of a list as an outline, it should be a little clearer. Consider this:
I. The top level
II. Second topic of the top level
- A. Subtopic belonging to II
- B. Subtopic belonging to II
III. Third topic of the top level
CSS and XHTML
dElaphant (and Zeppo his dog (and Gummo, Zeppos dog)) - Left my apostrophes at the BBC Posted Oct 4, 2002
If you were to move item II to another position in the list, you would want A and B to remain with it since they are subsidiary - they are *part of item II*, not the next item in the list.
So your corrected list should actually be this:
list one item one
list one item two
list two item one
list two item two
list one item three
since presumbly the second list, being indented under "list one item two" would be subsidiary to it.
CSS and XHTML
dElaphant (and Zeppo his dog (and Gummo, Zeppos dog)) - Left my apostrophes at the BBC Posted Oct 4, 2002
CSS and XHTML
DoctorMO (Keeper of the Computer, Guru, Community Artist) Posted Oct 4, 2002
I thought so too, I forgot about the tabs so the post ended up a bit , rushing does that so whats the general feeling? W3C are right?
I think so, being a programmer of other lanuages.
-- DoctorMO --
CSS and XHTML
Ion the Naysayer Posted Oct 4, 2002
Naturally h1 and p don't make sense like that. That's why the lists don't make sense to me the way they are.
Why should a list container not be allowed to contain another container without having content? It makes more sense to me to put a container into a container than to put a container into the content...
Why does a list necessarily have to be an outline? They don't _have_ to be used as summaries or tables of contents.
I understand why it is the way it is but that doesn't mean that I agree that that's necessarily the best way to do it. It makes the assumption that every sublist needs to be the child of a list item which isn't always the case.
If you apply the same logic to and elements, it should follow that a heading needs to be attached to the paragraphs associated with it. Obviously this isn't the way it works and because of the way the box model relates to the and elements, doing it that way is non-sensical but do you see what I'm getting at?
Either behaviour is useful under different circumstances but I think they should have made it consistent because it's easier on the HTML author. The programmer should be going out of the way for the author, not the other way around.
CSS and XHTML
Frankie Roberto Posted Oct 4, 2002
Incidentally, XHTML 2 does away with and marks headings up like this:
quick introduction</>
Part 1
some content
Sub-division 1
Sub-division 1
Conclusion
CSS and XHTML
dElaphant (and Zeppo his dog (and Gummo, Zeppos dog)) - Left my apostrophes at the BBC Posted Oct 4, 2002
Really? Then putting everything in a does make it more consistent, to work more like tables and lists.
Ion, if it makes sense to you to have embedded lists the way you suggest, then the following would be legal:
An item>
But then how would that be rendered? It makes the part meaningless except for changing the type of bullet (and that can be done in better ways). The point is that the is there to contain items, just like , and having something floating around in it without delineation (the <li> is pointless.
I do see what you're getting at, but I think you're looking at it backwards.
CSS and XHTML
DoctorMO (Keeper of the Computer, Guru, Community Artist) Posted Oct 4, 2002
I think if what your sujesting is that you wanted two difrent styles...
First Item
Second Item
First Item
Second Item
then...
UL.First
{
/*Style here*/
}
UL.Second
{
/*Style here*/
}
Would this not be more apropriat for none parenting nodes?
-- DoctorMO --
Key: Complain about this post
CSS and XHTML
- 1: Nireena (Oct 4, 2002)
- 2: Ion the Naysayer (Oct 4, 2002)
- 3: HappyDude (Oct 4, 2002)
- 4: Ion the Naysayer (Oct 4, 2002)
- 5: Ion the Naysayer (Oct 4, 2002)
- 6: Nireena (Oct 4, 2002)
- 7: dElaphant (and Zeppo his dog (and Gummo, Zeppos dog)) - Left my apostrophes at the BBC (Oct 4, 2002)
- 8: DoctorMO (Keeper of the Computer, Guru, Community Artist) (Oct 4, 2002)
- 9: Nireena (Oct 4, 2002)
- 10: DoctorMO (Keeper of the Computer, Guru, Community Artist) (Oct 4, 2002)
- 11: Nireena (Oct 4, 2002)
- 12: Ion the Naysayer (Oct 4, 2002)
- 13: dElaphant (and Zeppo his dog (and Gummo, Zeppos dog)) - Left my apostrophes at the BBC (Oct 4, 2002)
- 14: dElaphant (and Zeppo his dog (and Gummo, Zeppos dog)) - Left my apostrophes at the BBC (Oct 4, 2002)
- 15: dElaphant (and Zeppo his dog (and Gummo, Zeppos dog)) - Left my apostrophes at the BBC (Oct 4, 2002)
- 16: DoctorMO (Keeper of the Computer, Guru, Community Artist) (Oct 4, 2002)
- 17: Ion the Naysayer (Oct 4, 2002)
- 18: Frankie Roberto (Oct 4, 2002)
- 19: dElaphant (and Zeppo his dog (and Gummo, Zeppos dog)) - Left my apostrophes at the BBC (Oct 4, 2002)
- 20: DoctorMO (Keeper of the Computer, Guru, Community Artist) (Oct 4, 2002)
More Conversations for Website Developer's Forum
Write an Entry
"The Hitchhiker's Guide to the Galaxy is a wholly remarkable book. It has been compiled and recompiled many times and under many different editorships. It contains contributions from countless numbers of travellers and researchers."