Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Usage of HTML5 Tags

Tags:

html

css

Questions

  1. On average, has the usage of HTML5 semantic tags increased compared to the usage of CSS layers (div)?
  2. Also, is there a good difference between them and does it optimize the code for better speed and maintainability?
  3. Differences in character length is not much and <div id="footer"> is compatible in older browser without using Modernizr or other Javascript solutions to emulate support of HTML5 in non supported browsers. Therefore, if I only use semantic tags of HTML5, and not using any advance functionality of HTML5 like audio, video, etc. am I missing something?

Examples

HTML

<footer> and <div id="footer">

CSS

#footer {} and Footer {}

like image 947
Jitendra Vyas Avatar asked Apr 28 '11 05:04

Jitendra Vyas


People also ask

What is the use of tags in HTML5?

Complete HTML/CSS Course 2022 New Tag:Specifies a piece of content that is only slightly related to the rest of the page. New Tag:Specifies an audio file. New Tag:This is used for rendering dynamic bitmap graphics on the fly, such as graphs or games. New Tag:Specifies a command the user can invoke.

What are tags are used for?

People use tags to aid classification, mark ownership, note boundaries, and indicate online identity. Tags may take the form of words, images, or other identifying marks. An analogous example of tags in the physical world is museum object tagging.

What is the common use of HTML tags?

HTML tags are used to create HTML documents and render their properties. Each HTML tags have different properties. An HTML file must have some essential tags so that web browser can differentiate between a simple text and HTML text.

Which tags are used for HTML5 graphics?

The <canvas> tag is used to draw graphics, on the fly, via scripting (usually JavaScript).


2 Answers

From what I've seen and experienced, HTML5 tags like and are mainly provided for SEO so that search engines can (one day?) possibly use those sections and other tags properly.

Like you said, most of the tags are semantic and provide no real functional benefit- in fact, most break rendering in older browsers. I ran into an issue with these new tags when I tried dynamically loading HTML5 content with jQuery and the HTML5Shiv.js/Modernizr.js. I was unable to properly render the elements that were dynamically loaded in older browsers such as IE8 and IE7.

At this point, I'd recommend sticking with divs, as they're more widely used and provide better cross-browser functionality.

My two cents.

like image 59
ebrandell Avatar answered Sep 25 '22 01:09

ebrandell


On average, has the usage of HTML5 semantic tags increased compared to the usage of CSS layers (div)?

You are conflating two different ideas here. CSS can be applied to new elements just as easily as it can to old ones. The use of CSS is independent of use of semantics.

Also, is there a good difference between them and does it optimize the code for better speed and maintainability?

Speed? Certainly not.

Maintainability? Well, they reduce div soup, so in theory, yes.

The advantage comes from having more semantics in the document, so tools can extract relevant parts of documents, skip over sections, etc.

Differences in character length is not much and is compatible in older browser without using Modernizr or other Javascript solutions to emulate support of HTML5 in non supported browsers. Therefore, if I only use semantic tags of HTML5, and not using any advance functionality of HTML5 like audio, video, etc. am I missing something?

Err… you're missing audio and video. (Whether that matters for your site is another story)

like image 26
Quentin Avatar answered Sep 27 '22 01:09

Quentin