HTML5:
<menu type="list">
<li><a href="/signup/"> Sign Up </a></li>
<li><a href="/login/"> Log In </a></li>
</menu>
I want to add a signup / login menu to my website.
<menu>
be semantic? <ul>
instead?Edit: I'm using semantic HTML5. Browser support is irrelevant.
As I'm sure you're aware:
The menu element represents a list of commands.
It really just depends on how you define "list" and "commands." Are "Login" and "Sign up" commands? Or are they list items? Personally I think they're commands. A list (ul
or ol
) is more akin to something longer, two items just don't seem to make a list, to me. Login and Sign up seem like commands because they're what Stephen Krug, in Don't Make Me Think calls "Utilities":
Utilities are links to important elements of the site that aren't really part of the content hierarchy.
These are contrasted with what he calls "Sections":
links to the main sections of the site: the top level of the site's hierarchy [navigation]
This makes sense semantically: You use <nav>
for Krug's "sections" (navigation) and <menu>
for utilities or commands (Log in, Sign Up, Search, etc.)