Skip to content Skip to sidebar Skip to footer

Why Use Lists For Navigation?

Since I've started learning css and html (now bear in mind that has only been a few weeks) I've been using inline-block anchors for my navigation menus, no lists. Just a div with a

Solution 1:

As a rule of thumb: always try to use those elements that describe best what you want to express. A menu typically is a list of entries. So use a list.

The fact that you can mimic such a list using other elements is not wrong. But it does not change a thing. A list is a list and should be written as a list. It is more intuitive and easier to understand for others. Also for you yourself when you come back to your code much later.

The same principle applies in other situation. An example: why not use tables for layout purposes? It has been done for at least two decades of web programming and works pretty well. Some people still do it. But layout typically does not deal with tables. It typically deals with a 2 dimensional layout, where elements are positioned absolute or relative to each other. So the clean solution is to do exactly that. Using markup, positioning, floats, cleans, containers and the like. Do not miss use things when you can implement a clean solution.


Post a Comment for "Why Use Lists For Navigation?"