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

HTML5

Last Updated : 13 Jun, 2024
Summarize
Comments
Improve
Suggest changes
Like Article
Like
Save
Share
Report
News Follow

HTML stands for HyperText Markup Language. It is used to design web pages using a markup language. Hypertext defines the link between the web pages. A markup language is used to define the text document within the tag which defines the structure of web pages.

HTML5 Tutorial

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). It has introduced various new features like drag and drop, geo-location services, multimedia features, easy doctype declaration, offline data storage, graphic elements, and various semantic tags like the article, section, header, footer, figure, summary, etc. It is supported by all modern browsers.

Why HTML5?

Below are some differences that may or may not have caught your attention since developers started using HTML5:

  • Some data can be stored on the user’s device, which means apps are cached and can continue to work properly without an Internet connection.
  • Web pages can display fonts with a wider array of colors, shadows, and other beautiful effects.
  • Objects on the page can be more responsive and can move in response to the user’s cursor movements.
  • New elements like section, header, article, and nav can replace most div elements, which helps eliminate div soups and makes it easier to scan for mistakes.
  • Before HTML5 cookies which hold a limited amount of data were the only reliable way to store data, HTML5’s localStorage provides developers a way to work around the stateless nature of the HTTP protocol.
  • Browsers can display interactive 3D graphics using the computer’s own graphics processor.
  • By limiting the need for external plugins, HTML5 allows for faster delivery of more dynamic content.

What’s new in HTML5?

  1. Audio and Video: HTML5 has two key additions: audio and video tags. It enables website developers to insert video or music into their pages.
  2. Vector Graphics: This is a new feature in the updated version that has had a significant impact on the use of Adobe Flash in websites. It may be used to create visuals using a variety of shapes and colors using scripting, most commonly JS. Scalable vector graphics are simple to generate and manipulate.
  3. Header and Footer: There is no need to use a div> tag to separate the two elements with these new tags. The footer appears at the bottom of the page, while the header appears at the top. The browser will know what to load first and what to load later if you use the HTML5 elements header and footer.
  4. Figure and Figcaption: The <figure> element in HTML5 can be used to mark up a photo in a document, and the <figcaption> element can be used to define a caption for the photo. A caption for a figure element is defined using the <figcaption> tag.
  5. Nav tag: The <nav> tag defines a set of navigation links. It is used for the part of an internet site that links to different pages on the website.
  6. Progress tag: The progress tag is used to check the progress of a task during the execution. Progress tag can be used with the conjunction of JavaScript.
  7. Placeholder Attribute: The placeholder attribute offers a brief description of an input field’s/text area’s intended value. Before the user inputs a value, a small hint appears in the field.
  8. Email attribute: When the form’s input type is set to email, the browser receives instructions from the code to write an email in a valid format. The format of the input email id is automatically verified to ensure that it is correct.
  9. Storage: In HTML, we can utilize the browser as temporary storage, however in HTML5, we use an application cache, a web SQL database, and web storage.
  10. Ease of use: While HTML5 has hazards, such as constant modifications, the simplified syntax makes it easier to keep up with changes and updates than other versions of HTML.

What has been dropped?

  1. The HGROUP Element: The HGROUP element was created to group together one or more H1-H6 elements, usually a title and its subtitle. It was designed for a document outlining algorithms, with the goal of omitting all but the highest level heading from the resulting document outline.
  2. The CENTER Element: All of its content is horizontally centered within its containing element. It has always come in handy for centering headings and tables.
  3. The SCOPED Attribute: The SCOPED attribute was unique to the STYLE element and served as a boolean switch, indicating whether or not the styles should be applied to the STYLE block’s container element and child elements rather than the entire document.

Example:

HTML
<!DOCTYPE html>
<html>

<head>
    <title>HTML 5</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

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
HTML5 | Introduction
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 f
6 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