Is unordered list necessary on the following example?
As it's valid markup, I have done the following;
<div class="list">
<a href="#">Link 1</a>
<a href="#">Link 2</a>
</div>
My question is, does it have to be written as this;
<ul class="list"> 开发者_如何转开发
<li><a href="#">Login to Broker Site</a></li>
<li><a href="#">Register</a></li>
</ul>
what are the + and - of doing one than the other? And are these both correct according to semantic web?
Thanks.
It totally depends on the greater context, but seeing as it seems to be a navigational sub-menu, a ul
is indeed the most semantically correct element to use.
The clue is in the class name you chose.
As you see it as a list then use a list. This is a lot more semantic and is helpful for screen readers, which will then treat the contents as a list of links.
精彩评论