03-20-2008, 01:20 PM
|
#12 (permalink)
|
|
Moderateur
Join Date: Apr 2007
Posts: 1,393
Thanks: 5
|
Quote:
Originally Posted by Aaron
HTML Code:
<div id="HomeFooter">
<ul>
<li><a href="#">Footer Text</a></li>
</ul>
</div>
|
Why not any of the following?
HTML Code:
<!-- *far* more concise than your html -->
<p id="footer"><a href="..." title="...">Footer Text</a></p>
<!-- oh, so you did want a list? -->
<ul id="footer">
<li><a href="..." title="...">Footer Text</a></li>
<li><a href="..." title="...">Footer Text</a></li>
</ul>
I know you were just giving an example, but it's always nice to give useful, reasoned examples. Notice the title attribute for all links, I think that was an important omission in your example, since we're on the subject of giving elements meaning.
Quote:
|
Divs used correctly name elements. So their intended purpose is to provide a block level <span>
|
Um, no that's not it at all. The DIV element is there to DIVide a document into a sub-section. A DIV used correctly defines a discrete section of the document, with or without a name or some form of labelling/hook for CSS styles to reference.
The fact that browsers display a DIV at a block level is merely convention (it makes sense) but a DIV can quite happily be used inline or floated and still have good semantic value -- the DIV is dividing up the document, regardless of how the document is presented. A SPAN is something entirely different, and its meaning is easy to understand; just read the tag literally and you've got it.
|
|
|
|