Do I have to use ul
/ol
elements when I make navbars/other groups of links or it is optional?
Is it ok to replace this code
<div>
<ul style="list-style: none">
<li style="display: inline-block"><a href="#">fb page</a></li>
<li style="display: inline-block"><a href="#">twitter account</a></li>
<li style="display: inline-block"><a href="#">stackoverflow account</a></li>
</ul>
</div>
by
<div>
<a href="#" style="display: inline-block">fb page</a>
<a href="#" style="display: inline-block">twitter account</a>
<a href="#" style="display: inline-block">stackoverflow account</a>
</div>
?
Structurally and theoretically speaking speaking, a menu is a list of links, so your markup should reflect it as a list of links. You can style it to make the effects of the list invisible in graphical browsers.
Practically speaking, structure is useful. Look at what happens if you don't have the list and you view the page without a stylesheet. Can you tell where one link ends and the next begins?