I’m making a navigation menu, should I be using the <nav> element or <ul> element for that?
If I use a nav I’ll prob need to use a shiv so that it works across browsers.
If that’s so, what the advantage of using a nav over a ul?
EDIT:
I know you can put a ul into a nav my question is why use a nav at all?
Don’t get confuses with
<nav>and<ul>. They both can be used together for a navigation menu.Navis an HTML5 tag. If you are creating something in HTML5 you can use<nav>as there is no restriction, but not all browser will render this correctly.Ulcreates an unordered list. Unordered means the items in the list will not be in any particular order. You can nest anulelement insidenavto place your links.Read more about the HTML tags and how they work here.
This will create a navigation bar you have to put some CSS styles to look it better.
The above both code will produce the same result. The only difference is that
navtells the browser that this element is for navigation purpose s.