
Originally Posted by
Stomme poes
What's wrong with this?
Well, structurally you have made CATS content of COLLARS... which is why CATS would end up needing to be inside a equal level heading tag to DOGS, which should also be a heading tag to group the tags below it... Which would end up one hell of a lot of heading tags on list... when they are line items and their sub content. Saying LI basically SAYS it's the item in the first place and any tags are subsections of the text - so you don't NEED heading tags in the first place.
To be brutally honest... I wouldn't be USING list tags on that at all... excepting perhaps the innermost elements and even then.
To me list items are for short bullet points, single small elements - NOT as wrapping containers for entire blocks of multiple block-level tags. If you are using headings you are already implying ALL the semantic meaning you need on those.
Code:
<h2>Product List</h2>
<h3><a href="\dogs">DOGS</a></h3>
<h4>Beds</h4>
<h5><a href="\dogs\beds\30plain">Poochie Peach 30" plaid bed</a></h5>
<img src="thebedphoto" alt="Poochie Peach 30" plaid bed" />
<p> Product description, size, pattern, colours, price, made in India</p>
<h5><a href="\dogs\beds\80suede">Fatass Brown 80" suede bed</a></h5>
<img src="thebedphoto" alt="Fatass Brown 80" suede bed" />
<p> Product description, size, pattern, colours, price, made in India</p>
<h4>Bowls</h4>
<!-- same h5/img/p format -->
<h4>Collars</h4>
<!-- same h5/img/p format -->
<h3><a href="\dogs">CATS</a></h3>
Provides ALL the semantic meaning you need without the extra tags. You can take the meaning of a "LIST" too far, and applying headings to the list is usually a good indication it shouldn't be in a LIST tag in the first place. (I MIGHT be tempted to throw some DIV around the innermost, but that would just be to contain the IMG which I'd probably be floating)
I mean, think about what a screen reader would do to your example... think about how that looks when CSS isn't present or what LYNX would do it it. You turn off CSS your example ends up pure gibberish.
But that's part of what makes my approach to coding different from others, I start out pretending CSS and presentation doesn't even exist when making my markup.
If I WERE to use a list, I'd be wrapping my above code in the lists for each level... But frankly I think that's a waste of markup and applying non-semantic meanings through tag abuse.
Bookmarks