The Wayback Machine - https://web.archive.org/web/20241004174434/https://www.geeksforgeeks.org/html5-introduction/
Open In App

HTML5 | Introduction

Last Updated : 10 Jan, 2023
Summarize
Comments
Improve
Suggest changes
Like Article
Like
Save
Share
Report
News Follow

Introduction: HTML stands for Hyper Text Markup Language. It is used to design web pages using a markup language. HTML is an abbreviation of Hypertext and Markup language. Hypertext defines the link between the web pages. The markup language is used to define the text document within the tag which defines the structure of web pages. HTML 5 is the fifth and current version of HTML. It has improved the markup available for documents and has introduced application programming interfaces (API) and Document Object Model (DOM). 

Features:

  • It has introduced new multimedia features which supports both audio and video controls by using <audio> and <video> tags.
  • There are new graphics elements including vector graphics and tags.
  • Enrich semantic content by including <header> <footer>, <article>, <section> and <figure> are added.
  • Drag and Drop- The user can grab an object and drag it further dropping it to a new location.
  • Geo-location services- It helps to locate the geographical location of a client.
  • Web storage facility which provides web application methods to store data on the web browser.
  • Uses SQL database to store data offline.
  • Allows drawing various shapes like triangle, rectangle, circle, etc.
  • Capable of handling incorrect syntax.
  • Easy DOCTYPE declaration i.e., <!doctype html>
  • Easy character encoding i.e., <meta charset=”UTF-8″>

Removed elements from HTML 5: There are many elements which are depreciated from HTML 5 are listed below:

Removed Elements Use Instead Elements
<acronym> <abbr>
<applet> <object>
<basefont> CSS
<big> CSS
<center> CSS
<dir> <ul>
<font> CSS
<frame>  
<frameset>  
<noframes>  
<isindex>  
<strike> CSS, <s> or <del>
<tt> CSS

New Added Elements in HTML 5:

  • <article>: The <article> tag is used to represent an article. More specifically, the content within the <article> tag is independent from the other content of the site (even though it can be related).
  • <aside>: The <aside> tag is used to describe the main object of the web page in a shorter way like a highlighter. It basically identifies the content that is related to the primary content of the web page but does not constitute the main intent of the primary page. The <aside> tag contains mainly author information, links, related content and so on.
  • <figcaption>: The <figcaption> tag in HTML is used to set a caption to the figure element in a document.
  • <figure>: The <figure> tag in HTML is used to add self-contained content like illustrations, diagrams, photos or codes listing in a document. It is related to main flow, but it can be used in any position of a document and the figure goes with the flow of the document and if it is removed it should not affect the flow of the document.
  • <header>: It contains the section heading as well as other content, such as a navigation links, table of contents, etc.
  • <footer>: The <footer> tag in HTML is used to define a footer of HTML document. This section contains the footer information (author information, copyright information, carriers etc.). The footer tag is used within body tag. The <footer> tag is new in the HTML 5. The footer elements require a start tag as well as an end tag.
  • <main>: Delineates the main content of the body of a document or web app.
  • <mark>: The <mark> tag in HTML is used to define the marked text. It is used to highlight the part of the text in the paragraph.
  • <nav>: The <nav> tag is used to declaring the navigational section in HTML documents. Websites typically have sections dedicated to navigational links, which enables user to navigate the site. These links can be placed inside a nav tag.
  • <section>: It demarcates a thematic grouping of content.
  • <details>: The <details> tag is used for the content/information which is initially hidden but could be displayed if the user wishes to see it. This tag is used to create interactive widget which user can open or close it. The content of details tag is visible when open the set attributes.
  • <summary>: The <summary> tag in HTML is used to define a summary for the <details> element. The <summary> element is used along with the <details> element and provides a summary visible to the user. When the summary is clicked by the user, the content placed inside the <details> element becomes visible which was previously hidden. The <summary> tag was added in HTML 5. The <summary> tag requires both starting and ending tag.
  • <time>: The <time> tag is used to display the human-readable data/time. It can also be used to encode dates and times in a machine-readable form. The main advantage for users is that they can offer to add birthday reminders or scheduled events in their calendars and search engines can produce smarter search results.
  • <bdi>: The <bdi> tag refers to the Bi-Directional Isolation. It differentiates a text from other text that may be formatted in different direction. This tag is used when a user generated text with an unknown direction.
  • <wbr>: The <wbr> tag in HTML stands for word break opportunity and is used to define the position within the text which is treated as a line break by the browser. It is mostly used when the used word is too long and there are chances that the browser may break lines at the wrong place for fitting the text.
  • <datalist>: The <datalist> tag is used to provide autocomplete feature in the HTML files. It can be used with input tag, so that users can easily fill the data in the forms using select the data.
  • <keygen>: The <keygen> tag in HTML is used to specify a key-pair generator field in a form. The purpose of <keygen> element is to provide a secure way to authenticate users. When a form is submitted then two keys are generated, private key and public key. The private key stored locally, and the public key is sent to the server. The public key is used to generate client certificate to authenticate user in future.
  • <output>: The <output> tag in HTML is used to represent the result of a calculation performed by the client-side script such as JavaScript.
  • <progress>: It is used to represent the progress of a task. It also defines how much work is done and how much is left to download a task. It is not used to represent the disk space or relevant query.
  • <svg>: It is the Scalable Vector Graphics.
  • <canvas>: The <canvas> tag in HTML is used to draw graphics on web page using JavaScript. It can be used to draw paths, boxes, texts, gradient and adding images. By default, it does not contain border and text.
  • <audio>: It defines the music or audio content.
  • <embed>: Defines containers for external applications (usually a video player).
  • <source>: It defines the sources for <video> and <audio>.
  • <track>: It defines the tracks for <video> and <audio>.
  • <video>: It defines the video content.

Advantages:

  • All browsers supported.
  • More device friendly.
  • Easy to use and implement.
  • HTML 5 in integration with CSS, JavaScript, etc. can help build beautiful websites.

Disadvantages:

  • Long codes have to be written which is time consuming.
  • Only modern browsers support it.

Supported Browsers: It is supported by all modern browsers. 

Below examples illustrate the HTML 5 content. 

Example 1: 

html




<!DOCTYPE html>
<html>
 
<head>
    <title>HTML 5</title>
    <style>
        h1 {
            font-size:50px;
        }
    </style>
</head>
     
<body>
    <h1>GeeksforGeeks</h1>
</body>
 
</html>                   


Output:

  

Example 2: 

html




<!DOCTYPE html>
<html>
 
<head>
    <title>HTML 5 Demo</title>
     
    <style>
        .GFG {
            font-size:40px;
            font-weight:bold;
            color:green;
        }
        body {
            text-align:center;
        }
    </style>
</head>
 
<body>
    <div class = "GFG">GeeksforGeeks</div>
    <aside>
        <div>A computer science portal for geeks</div>
    </aside>
</body>
 
</html>                   


Output:

 



Previous Article
Next Article

Similar Reads

HTML5 MathML Introduction
The MathML comes in HTML5 the current MathML version is 3 it was introduced in the year of 2015. MathML stands for Mathematics Markup Language. It is used to represent mathematical equations or expressions in web browsers like other HTML elements. The 1st version of MathML was released in the year of 1998 and after that the 2nd version was released
5 min read
How to set a name for keygen element in HTML5 ?
In HTML, the <keygen> tag is used to specify a key-pair generator field during a form, and the <keygen> name attribute is used to set the name of the keygen element. The aim of <keygen> element is to supply a secure thanks to authenticate users. When a form is submitted then two keys are generated, the private key and the public k
2 min read
How to define the URL of an external script file in HTML5 ?
In this article, we will learn how to define the URL of an external script file inside HTML. This may be needed when a large script code is needed to be included, and it may create confusion if all the code is written in a single file. Also, there may be a requirement for the same script to execute on different web pages, and rewriting the same cod
1 min read
How to change the font of HTML5 Canvas using a button in Angular.js?
In this article, we are going to learn about how to change the font of HTML5 Canvas using a button in AngularJS. With the help of a click font's property can change by the user whether it is font-size or font-style. Syntax: For font size (Change the font size accordingly): variable.fontSize = "100px" For font style (Change the font style accordingl
2 min read
How to define a client-side script in HTML5 ?
To define a client-side script in HTML5, we can do <script> tag or adding external script file by src attribute to the HTML file. <script> tag contains the JavaScript to be added for the client-side scripting. Syntax: <script> // JavaScript goes here console.log('GeeksforGeeks'); </script> Below are the examples for the abov
1 min read
HTML5 Game Development | Infinitely Scrolling Background
Game Design and Development is an emerging industry. Although making AAA titles will require advanced knowledge of game engines, DirectX, OpenGL, etc. small HTML5 video game projects is a good place to start. HTML5 canvas and javascript can be used to make small games while learning the fundamentals of game development like Collision-Detection, Obj
5 min read
HTML5 | Mathematical operators
Mathematical Operators are used for representation of mathematical and technical operators. In HTML5 some special codes are used. For the representation of these operators we can use the name or hexadecimal(Hex) reference. Examples: Input : &minus or &#8722 Output : - Input : &times or &#215 Output : x Input : &frac34 or &#1
1 min read
HTML5 MathML <menclose> Tag
The HTML5 MathML <menclose> tag tag is an inbuilt element in HTML5. It is used to renders the contents which is inside of anbenclosing notation specified by the notation attribute. Syntax: <menclose attribute="value "> child elements </menclose">Attributes: The tag accepts some attributes which are listed below: class| id| style:
2 min read
HTML5 MathML rowspan Attribute
This attribute holds the value that how many rows does the cell extend. This attribute is accepted by the <mtd> tag only. Syntax: <element rowspan="non-negative-int"> Attribute Values: non-negative-int: This value holds the integer that create the span by rows. Below example illustrate the rowspan in HTML MathML: Example: C/C++ Code
1 min read
HTML5 MathML rowlines Attribute
This attribute holds the row borders value that multiple value can be separated by using a space can consider also. Possible values are none, solid and dashed. This attribute is accepted by <mtable> tag only. Syntax: <element rowlines="none|solid|dashed"> Attribute Values: none: This attribute sets the row lines of the table none.solid:
1 min read
HTML5 date attribute in <input> Tag
The date attribute in the input tag creates a calendar to choose the date, which includes day, month, and year. Syntax: <input type = "date">Example 1: Use date attribute in input tag C/C++ Code <!DOCTYPE html> <html> <head> <title>Date Attribute</title> </head> <body> <form action="/"
1 min read
How to add video in HTML5 ?
In This article, we will define how to add video content using a <video> element in the document. Before HTML5 came into existence, videos could only be played in a browser using a plugin like flash, but after the release of HTML5, adding a video to a web page is easy as adding an image. The HTML5 “video” element specifies a standard way to e
1 min read
How to set the language of text in the linked document in HTML5 ?
The approach of this article is to specify the language of the text in the linked document in HTML5 by using a hreflang attribute in the HTML Tag. The value (or languageCode) passed here is the code of the linked document. (for e.g. if the document/website in the given link is in English en is passed as the value). Syntax: <element hreflang="lan
1 min read
Change an HTML5 input placeholder color with CSS
The placeholder selector in the CSS pseudo-element is used to design the placeholder text by changing the text color and it allows to modify the style of the text. In most of the browsers, the placeholder (inside the input tag) is of grey color. In order to change the color of this placeholder, non-standard ::placeholder selectors can be used, whic
2 min read
HTML5 MathML <merror> Tag
The HTML5 MathML <merror> tag tag is an inbuilt element in HTML5 which is used to wrap the expression in a box, makes that expression eye-catching. This tag is used to display the error message. Normally it alone can't just pop out when your MathML markup is wrong or any kind of error occurs, you will get an XML parsing. Syntax: <merror
2 min read
How to specify the media type of the script in HTML5 ?
The HTML <script> type attribute specifies the type of script that is being represented. The type attribute identifies the content that appears between the <script> and </script> tags. It specifies the script's MIME type and identifies the Tag's content. It has a single value, media type, that specifies the MIME type of the script
1 min read
How to group header content of a table using HTML5 ?
In this article, we define to group the header content in a table by using the <th> tag in HTML to set the header cell of a table. Two types of cells in an HTML table. Header Cell: It is used to hold the header information. Standard Cell: It is used to hold the body of data. The working of both tags (<th> and <td>) are same but th
1 min read
Form required attribute with a custom validation message in HTML5
The creation of web forms has perpetually been a fancy task. whereas marking up the shape itself is simple, checking whether or not every field features a valid and coherent price is tougher, and informing the user concerning the matter might become a headache. HTML5 introduced new mechanisms for forms. There 2 kinds of Constraint Validation DOM Me
4 min read
HTML5 MathML <maction> tag
The HTML5 MathML <maction> tag is an inbuilt element of HTML5, that is used to show the bind action of any expression. You can use any selection attribute with this element. Syntax: <maction> child elements </maction> Attributes: The <maction> tag accepts below-mentioned attributes: actiontype: This attribute contains three
2 min read
HTML5 MathML <mfrac> tag
The HTML5 MathML <mfrac> tag is an inbuilt element in HTML5. It is use to add fraction symbol between two digits or equations. Syntax: <mfrac> numerator denominator </mfrac> Attributes: This tag accepts below mentioned attribute: bevelled: This attribute holds the value how the fraction will be displayed if the value is true then
2 min read
HTML5 MathML <mglyph> Tag
The MathML <mglyph> tag in HTML5 is used to print non-standard symbols. It is used only for those characters or symbols that are not available on Unicode characters. Syntax: <mglyph src="pathe" alt="" width="value" height="value"/>Attributes: This tag accepts some attributes which are listed below: alt: This attribute defines the altern
1 min read
HTML5 MathML <mn> Tag
The MathML <mn> tag in HTML5 is used to display a numeric character which is normally a sequence of digits with a possible separator. It contains the arbitrary character and used like 4 as Four. Syntax: <mn> Numeric </mn>Attributes: It accepts some attributes which are listed below: class|id|style: This attribute is used to hold t
2 min read
HTML5 MathML <mlabeledtr> tag
The MathML <mlabeledtr> tag in HTML5 is used to represent a label in a row, either on the left or on the right side inside of the <mtable> element. Child of this element is similar to normal table followed by m like <td> become <mtd>. Syntax: <mlabeledtr> element </mlabeledtr> Attributes: This tag accepts some at
2 min read
HTML5 MathML <mfenched> tag
The MathML <mfenched> tag in HTML5 is used to add custom open and closing parentheses. Like you can open any parentheses and can close different brackets and separators. Syntax: <mfenced open="parentheses" close="parentheses" separators=" "> child elements</mfenced>Attributes: This tag accepts some attribute which are listed below
1 min read
HTML5 MathML <math> tag
The MathML <math> tag in HTML5 is the most prioritized element. Whatever MathML element you want to use should be wrapped inside of the <math> tag. Syntax: <math> child elements </math> Attributes: The tag accepts some attributes which are listed below: class|id|style: This attribute is used to hold the styles of the child e
2 min read
HTML5 MathML <mi> Tag
The MathML <mi> tag in HTML5 is used as an identifier such as any kind of symbol or function. You can put any statement inside this tag. Syntax: <mi> element </mi> Attributes: This tag accepts some attributes which are listed below: class|id|style: This attribute is used to hold the styles of the child elements.href: This attribut
2 min read
HTML5 | MathML <msubsup> Tag
The MathML <msubsup> tag in HTML5 is used to print base power and power on any expression. This means Superscript and subscript both can be used at the same time. Syntax: <msubsup> child elements </msubsup> Attributes: This tag accepts some attributes which are listed below: class|id|style: This attribute is used to hold the style
1 min read
HTML5 | MathML <mroot> Tag
The MathML <mroot> tag in HTML5 is use to display the power of the root like root squire.Syntax: <mroot> child elements </mroot> Attributes: This tag accepts some attributea which are listed below: class|id|style: This attribute holds the styles of the child elements.mathbackground: This attribute holds the value of the math expre
1 min read
HTML5 | MathML <mrow> Tag
The MathML <mrow> tag in HTML5 is used to create a row that contains some mathematical expression or any random text. When you need to write some mathematical expressions, this tag is useful to make a grouping of the expression. By using <mrow> the expression will look nicer, clean with indentation plus line breaking. Syntax: <mrow
2 min read
HTML5 | MathML <mphantom> Tag
The MathML <mphantom> tag in HTML5 is used to rendered invisibly but the dimensional are still kept.Syntax: <mphantom> Child elements </mphantom> Attributes: This tag accepts some attributes which are listed below: class|id|style: This attribute is used to hold the styles of the child elements.mathbackground: This attribute holds
1 min read
Article Tags :