Basic Knowledge of HTML5
Introduction:
Hypertext Markup Language revision 5 (HTML5) is markup language for the structure and presentation of World Wide Web contents. HTML5 supports the traditional HTML and XHTML-style syntax and other new features in its markup, New APIs, XHTML and error handling.
There are three organizations that are currently in charge of the specification of HTML5:
- Web Hypertext Application Technology Working Group (WHATWG) created the HTML5 specification and is in charge of the HTML5 development that provides open collaboration of browser vendors and other involved parties.
- World Wide Web Consortium (W3C) is in charge with delivering the HTML5 specification.
- Internet Engineering Task Force (IETF) is in charge of the development of HTML5 WebSocket API.
HTML5 comes with a lot of flexibility and it supports the following features −
- Uppercase tag names.
- Quotes are optional for attributes.
- Attribute values are optional.
- Closing empty elements are optional.
The DOCTYPE
the Doctype in older version is written to longer bit in the HTML5 is just specify the doctype
<!DOCTYPE html>
Character Encoding
<meta charset = "UTF-8">
<link> tag
In older version there define the file types but here just defile the path of the file:-
<link rel = "stylesheet" href = "stylefile.css">
<script> tag
Script syntax also can write so simple as :
<script src = "scriptfile.js"></script>
HTML5 Attributes
In the HTML Attributes are be specified within start tags and must never be used in the end tags.
HTML5 attributes are case insensitive so we can write in all uppercase or mixed case, but most common convention is written with lowercase.
Custom Attributes
A new feature introduced in HTML 5 called as custom data attributes.
A custom data attribute starts with data- and the name will be user define.
Here is a simple example −
<div class = "example" data-name = "website" data-value = "dynamic">
...
</div>
there use two custom attributes called data-name and data-value. Using those attribute you able to get the values using JavaScript APIs or CSS in similar way as you get for standard attributes.