Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why use HTML5 tags? [duplicate]

Tags:

html

tags

html4

Possible Duplicate:
Are new HTML5 elements like <section> and <article> pointless?

I have decided to, finally, make the move to designing websites in HTML5. I have one question about the new tags.

There are new tags such as; header, footer, navbar, etc.. Why are these tags preferred over the older method of using DIV ID's (eg. <div id="header">). I can see why this would make things simpler but wouldn't it be more confusing to have some tags that use HTML5 and some tags that use the older method? I, personally, find it more logical to use all or none, rather than a mixture.

If I'm missing the point entirely please let me know.

like image 239
Brad Bird Avatar asked Jan 13 '13 16:01

Brad Bird


People also ask

Why is it good to use HTML5 tags?

For users who are blind or visually impaired and rely on screen readers to verbally describe what is on a page, proper use of HTML5 semantic elements will allow screen readers to more accurately communicate your content by making the visual audible.

Should I use HTML5 semantic markup?

One of the most important features of HTML5 is its semantics. Semantic HTML refers to syntax that makes the HTML more comprehensible by better defining the different sections and layout of web pages. It makes web pages more informative and adaptable, allowing browsers and search engines to better interpret content.

Why is the div element still used in HTML5?

The Div is the most usable tag in web development because it helps us to separate out data in the web page and we can create a particular section for particular data or function in the web pages. It is used to the group of various tags of HTML so that sections can be created and style can be applied to them.


1 Answers

It's not an either-or situation. HTML5 still has <div>s. It still has <span>s. The new tags are there to give you more expressive freedom and to standardize common elements. For instance, most pages have navigation bars, yet so far there was no standard for how those were marked up. If they're clearly marked up as <nav>, programs can start to use this information productively. Search engines can ignore or parse them and assistive technology can help the user navigate around the site.

It also makes it easier for you to work with your code. <nav> is so much easier to spot than <div class="main nav foobar baz">.

The new tags are an addition, not an entirely new set replacing the old tags.

like image 127
deceze Avatar answered Oct 22 '22 09:10

deceze