Let's say I have a set of links, can I use <div>
instead of <nav>
?
<div>
<ul>
<li class="head_divider">...</li>
<li class="head_divider">Text<br />Here</li>
<li class="head_divider">...</li>
</ul>
What is the difference between the two? they yield the same format/answer for me
<nav>
meant for more semantic markup (letting the browser know)
that those links aren't just normal links, they are a navigation
menu. This can be useful for accessibility (tabs, mobile
devices,browsers, such as screen readers for disabled users, can use
this element to determine whether to omit the initial rendering of
this content.) and other things.
For More reference on <nav>
:
https://www.w3.org/TR/html51/sections.html#the-nav-element
The <div>
tag defines a division or a section in an HTML document.
It is a block-level element that is commonly used to identify large
groupings of content, and which helps to build a web page’s layout
and design using CSS.
For more reference on <div>
: http://www.html-5-tutorial.com/div-tag.htm
When it comes to styling there is no big difference,
<nav>
<div>
Technically they work the same way, but for search engines that tells them there is a navigation area.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With