Skip to content
geeksforgeeks
  • Tutorials
    • Python
    • Java
    • Data Structures & Algorithms
    • ML & Data Science
    • Interview Corner
    • Programming Languages
    • Web Development
    • CS Subjects
    • DevOps And Linux
    • School Learning
    • Practice Coding Problems
  • Courses
    • DSA to Development
    • Get IBM Certification
    • Newly Launched!
      • Master Django Framework
      • Become AWS Certified
    • For Working Professionals
      • Interview 101: DSA & System Design
      • Data Science Training Program
      • JAVA Backend Development (Live)
      • DevOps Engineering (LIVE)
      • Data Structures & Algorithms in Python
    • For Students
      • Placement Preparation Course
      • Data Science (Live)
      • Data Structure & Algorithm-Self Paced (C++/JAVA)
      • Master Competitive Programming (Live)
      • Full Stack Development with React & Node JS (Live)
    • Full Stack Development
    • Data Science Program
    • All Courses
  • HTML Tutorial
  • HTML Exercises
  • HTML Tags
  • HTML Attributes
  • Global Attributes
  • Event Attributes
  • HTML Interview Questions
  • HTML DOM
  • DOM Audio/Video
  • HTML 5
  • HTML Examples
  • Color Picker
  • A to Z Guide
  • HTML Formatter
Open In App
Next Article:
HTML Spell Check
Next article icon

HTML5 | Introduction

Last Updated : 13 Jun, 2025
Comments
Improve
Suggest changes
Like Article
Like
Report

HTML5 is the fifth version of Hypertext Markup Language (HTML), a standard language used to structure webpages. It defines how content on a webpage should be structured and displayed. Here are some key points of HTML5

  • Multimedia Support: Embeds audio and video without plugins.
  • New Form Controls: Includes input types like date and email.
  • Web Storage: Stores data offline for better performance.
  • Semantic Elements: Uses tags like <header> and <footer> for better structure.
  • Improved Performance: Faster and more efficient, especially on mobile.

Here is a simple HTML5 example

HTML
<html> <head>     <meta charset="UTF-8">     <meta name="viewport" content="width=device-width, initial-scale=1.0">     <title>Simple HTML Page</title>  </head> <body>      <header>         <h1>Hello, World!</h1>     </header>      <main>         <p>This is a simple HTML5 page.</p>     </main>      <footer>         <p>@GeeksforGeeks, Sanchhaya Education Private Limited, All rights reserved</p>     </footer>  </body> </html> 
  • It defines a simple HTML5 page with DOCTYPE, <html>, <head>, and <body> tags.
  • Includes a character set (UTF-8) and viewport settings for mobile responsiveness.
  • Contains a header, main content, and footer with basic text content.

Evolution of HTML

HTML has gone through several changes over the years to keep up with the growing needs of web development. These changes have helped improve website design, functionality, and accessibility. Here's an overview of how it has evolved.

Early Web Browser Development:

  • In the early days of the web, major browser creators like Microsoft Internet Explorer and Mosaic Netscape introduced browser-specific elements to improve the appearance of web pages for their browsers.
  • This led to the creation of distinct versions of websites tailored for Internet Explorer and Netscape by the late 1990s.

HTML 3.2 (1996):

  • The World Wide Web Consortium (W3C) recommended the creation of HTML 3.2 in 1996.
  • This standard included commonly used HTML elements and introduced presentational extensions, like the <center> and <font> elements, which were developed during the browser rivalry between Internet Explorer and Netscape.

HTML 4.0 (1998) and HTML 4.01 (1999):

  • HTML 4.0, released in 1998, and its update HTML 4.01 in 1999, focused on separating content structure from presentation.
  • These versions emphasized improving accessibility and moving presentation elements to the newly introduced Cascading Style Sheets (CSS) standard.

New Added Elements in HTML 5

HTML5 introduced several new elements that help structure a webpage better and make it more interactive. These elements not only improve the design but also make the code more readable and accessible. Here are some key elements of HTML5:

  • <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.

Features of HTML5

HTML5 introduces several new elements and attributes to improve web development:

  • Semantic Elements:
    • New tags like <article>, <aside>, <nav>, <header>, <footer>, and <section> provide meaning and structure to the content, improving both accessibility and SEO.
  • Multimedia Support:
    • Native support for <audio> and <video> tags removes the need for third-party plugins like Flash.
  • Canvas API:
    • Allows drawing graphics, animations, and games directly in the browser using JavaScript.
  • Geolocation API:
    • Provides access to the user's geographical location (with permission), enabling location-based services.
  • Web Storage (localStorage and sessionStorage):
    • Local storage (localStorage) and session storage (sessionStorage) provide client-side data storage, improving performance and enabling offline functionality.
  • Web Workers:
    • Allows background processing of JavaScript, improving performance by preventing blocking of the main thread.
  • Form Enhancements:
    • New input types (e.g., date, email, number) and form validation make forms easier and more efficient to create.
  • Drag and Drop API:
    • Allows users to drag and drop elements within a web page or between applications, enhancing interactivity.
  • SVG Integration:
    • Improved support for Scalable Vector Graphics (SVG), allowing for resolution-independent vector graphics to be embedded directly into HTML.
  • WebSocket API:
    • Enables real-time, bidirectional communication bet.

Deprecated Elements in HTML5

HTML5 has removed several outdated elements, replacing them with newer, more flexible solutions:

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

HTML5 Advantages

  • Multimedia Support: Native audio and video tags for easier media embedding.
  • Better Performance: Faster loading times with fewer dependencies.
  • Cross-Platform: Works across all major browsers and mobile devices.
  • Geolocation: Access users’ location for location-based features.
  • Offline Capability: Works offline with Web Storage and AppCache.
  • Simplified Code: New semantic tags for cleaner, more readable code.
  • Mobile-Friendly: Optimized for a smoother mobile experience.

HTML5 Disadvantages

  • Browser Inconsistencies: Older browsers may not fully support HTML5 features.
  • Mobile Compatibility: Some older mobile devices may struggle with certain HTML5 features.
  • Security Risks: New features like Web Storage can potentially expose user data if not handled properly.
  • Complexity: Advanced features like WebSockets and APIs can be challenging for beginners.
  • Lack of Support in Older Internet Explorer Versions: Some older versions of IE (like IE 8 and below) do not support HTML5 at all.

More Example of HTML5

Adding a Video Using the <video> Tag

HTML
<html> <body>     <h1>HTML5 Video Example</h1>     <video width="320" height="240" controls>         <source src="movie.mp4" type="video/mp4">         Your browser does not support the video tag.     </video> </body> </html> 

In this example,

  • The <video> tag is used to embed a video in the HTML page.
  • The controls attribute adds play, pause, and volume control buttons.
  • The <source> tag specifies the video file and format. If the video is not supported, the text inside the <video> tag will be displayed.

Using the <canvas> Element for Drawing

HTML
<html> <body>     <h1>HTML5 Canvas Example</h1>     <canvas id="myCanvas" width="200" height="200"></canvas>     <script>         var canvas = document.getElementById("myCanvas");         var ctx = canvas.getContext("2d");         ctx.fillStyle = "blue";         ctx.fillRect(50, 50, 100, 100);     </script> </body> </html> 

In this example,

  • The <canvas> tag is used to create an area for drawing graphics using JavaScript.
  • The getContext(“2d”) method is used to set up a 2D drawing context on the canvas.
  • The fillRect method draws a blue rectangle within the canvas.

Using the <progress> Element to Show Task Progress

HTML
<html> <body>     <h1>HTML5 Progress Bar Example</h1>     <progress value="70" max="100"></progress> </body> </html> 
  • The <progress> tag is used to display a progress bar on the webpage.
  • The value attribute sets the current progress, and the max attribute defines the maximum value.

Best Practices of Using HTML5

  • Use Semantic Tags: Improve SEO and accessibility by using tags like <header>, <footer>, <article>, and <section>.
  • Ensure Cross-Browser Compatibility: Test your code across multiple browsers, especially older versions.
  • Use <meta charset=”UTF-8″>: Always specify the character encoding at the start to avoid encoding issues.
  • Mobile Responsiveness: Use the <meta name=”viewport” content=”width=device-width, initial-scale=1.0″> tag for mobile-friendly designs.

Browser Support for HTML5

  • Apple Safari, Google Chrome, Mozilla Firefox, and Opera (latest versions) provide extensive support for HTML5 features.
  • Internet Explorer 9.0 supports some HTML5 functionalities, although it is considered outdated.
  • Mobile browsers on iPhones,iPads, and Android devices offer excellent HTML5 support.
  • These mobile browsers ensure smooth access to modern web apps and features, providing a smooth experience on smartphones and tablets.

Next Article
HTML Spell Check

K

kartikgoel1999
Improve
Article Tags :
  • Web Technologies
  • HTML
  • HTML5

Similar Reads

    HTML Basics

    HTML Introduction
    HTML stands for Hyper Text Markup Language, which is the core language used to structure content on the web. It organizes text, images, links, and media using tags and elements that browsers can interpret. As of 2025, over 95% of websites rely on HTML alongside CSS and JavaScript, making it a fundam
    6 min read
    HTML Full Form
    HTML (Hypertext Markup Language) is a standard markup language used to design web pages. It describes the structure of a web page and consists of a series of elements. HTML tells the browser how to display the content, making it a crucial part of web development.This language can become more interac
    3 min read
    HTML Editors
    An HTML Editor is a software application designed to help users create and modify HTML code. It often includes features like syntax highlighting, tag completion, and error detection, which facilitate the coding process. There are two main types of HTML editors: Text-Based Editors - Allow direct codi
    5 min read
    HTML Comments
    HTML comments are used to add notes or explanations in the HTML code that are not displayed by the browser.They are useful for documenting the code, making it easier to understand and maintain.To add a comment, use the syntax <!-- your comment here -->. HTML<!-- This is a comment and will n
    4 min read
    HTML Basics
    HTML (HyperText Markup Language) is the standard markup language used to create and structure web pages. It defines the layout of a webpage using elements and tags, allowing for the display of text, images, links, and multimedia content. As the foundation of nearly all websites, HTML is used in over
    7 min read
    HTML Layout
    HTML layouts are a technique used to divide a web page into multiple sections, making it easier to apply styles, organize content, and manage operations efficiently. This division improves readability, accessibility, and overall user experience.HTML layout is achieved through elements like <heade
    4 min read
    HTML Elements
    An HTML Element consists of a start tag, content, and an end tag, which together define the element's structure and functionality. Elements are the basic building blocks of a webpage and can represent different types of content, such as text, links, images, or headings.For example, the <p> ele
    5 min read
    HTML Headings
    HTML headings are used to define the titles and subtitles of sections on a webpage. They help organize the content and create a structure that is easy to navigate.Proper use of headings enhances readability by organizing content into clear sections.Search engines utilize headings to understand page
    4 min read
    HTML Paragraphs
    A paragraph in HTML is simply a block of text enclosed within the <p> tag. The <p> tag helps divide content into manageable, readable sections. It’s the go-to element for wrapping text in a web page that is meant to be displayed as a distinct paragraph.Syntax:<p> Some Content...
    5 min read
    HTML Text Formatting
    HTML text formatting refers to the use of specific HTML tags to modify the appearance and structure of text on a webpage. It allows you to style text in different ways, such as making it bold, italic, underlined, highlighted, or struck-through. Table of ContentCategories of HTML Text FormattingLogic
    4 min read
    HTML Quotations
    HTML quotation elements are used to display quoted text on a web page, differentiating it from regular content. These elements help structure citations and quotations effectively within the document.TagDescription<abbr>Represents an abbreviation or acronym, typically with a title attribute to
    3 min read
    HTML Color Styles
    HTML color styles offer various ways to specify colors on a webpage. For Example using HSL (Hue, Saturation, Lightness) allows for intuitive color control, where you adjust hue for the type of color, saturation for intensity, and lightness for brightness. Here are the different styles that can be us
    3 min read
    HTML Links Hyperlinks
    HTML Links, also known as hyperlinks, are defined by the <a> tag in HTML, which stands for "anchor." These links are essential for navigating between web pages and directing users to different sites, documents, or sections within the same page. The basic attributes of the <a> tag include
    3 min read
    HTML Images
    The HTML <img> tag is used to embed an image in web pages by linking them. It creates a placeholder for the image, defined by attributes like src, width, height, and alt, and does not require a closing tag.There are two ways to insert the images into a webpage:By providing a full path or addre
    6 min read
    HTML Tables
    HTML (HyperText Markup Language) is the standard markup language used to create and structure web pages. It defines the layout of a webpage using elements and tags, allowing for the display of text, images, links, and multimedia content. As the foundation of nearly all websites, HTML is used in over
    10 min read
    HTML Lists
    An HTML List allows you to organize data on web pages into an ordered or unordered format to make the information easier to read and visually appealing. HTML Lists are very helpful for creating structured, accessible content in web development.Types of HTML ListsThere are three main types of lists i
    5 min read
    HTML Block and Inline Elements
    HTML elements are either block-level, which structure the layout and span full width (like <div> or <p>), or inline, which styles content within blocks without breaking the flow (like <span> or <a>). This distinction covers 80–90% of common HTML usage.Inline and Block Level E
    3 min read
    HTML Iframes
    An iframe, or Inline Frame, is an HTML element represented by the <iframe> tag. It functions as a 'window' on your webpage through which visitors can view and interact with another webpage from a different source.Iframes are used for various purposes like:Embedding Multimedia: Easily integrate
    4 min read
    How to Add JavaScript in HTML Document?
    To add JavaScript in HTML document, several methods can be used. These methods include embedding JavaScript directly within the HTML file or linking an external JavaScript file.Inline JavaScriptYou can write JavaScript code directly inside the HTML element using the onclick, onmouseover, or other ev
    3 min read
    HTML File Paths
    HTML file paths specify the location of files or resources that a webpage needs to access, such as images, videos, scripts, or other HTML documents. These paths tell the web browser where to find the files required to display the content correctly or to execute scripts as intended. To insert a file
    3 min read
    HTML Viewport meta tag for Responsive Web Design
    A Browser's viewport is the area of the web page in which the content is visible to the user. The viewport does not have the same size, it varies with the variation in screen size of the devices on which the website is visible. For a laptop, the viewport has a larger size as compared to a smartphone
    3 min read
    HTML Computer Code Elements
    HTML provides a set of elements tailored for displaying computer code so that it is easily distinguishable from other text on a webpage. These elements help in formatting and presenting source code in a readable and syntactically correct manner.Table of ContentThe code TagThe kbd TagThe pre TagThe s
    4 min read
    HTML Entities
    In HTML, there are reserved characters, such as < (less than) and > (greater than), which are used to define tags like <p>. However, if you use these reserved characters within the content, browsers may misinterpret them as part of the tags.HTML Entities were introduced to avoid this. Re
    4 min read
    HTML Charsets
    HTML charsets define how characters are represented in a web document. The character encoding ensures that text appears correctly across different devices and platforms.The <meta> tag's charset attribute is used to specify which character encoding the HTML document uses. By setting the charset
    4 min read
    HTML URL Encoding
    A Uniform Resource Locator (URL) is simply the address of a website to access the website content. Web browsers retrieve pages from web servers using a URL (Uniform Resource Locator).What is URL Encoding?URL Encoding is the process of converting the URL into a valid format that is accepted by web br
    4 min read
    HTML Deprecated Tags
    The deprecated tags or attributes are those attributes which are replaced by some other attributes. The tag or attributes deprecated when the same attributes is achieved by some other way. They are considered outdated and may not be supported in modern browsers or future versions of HTML. HTML Depre
    2 min read

    HTML Tags

    HTML DOCTYPE Declaration
    HTML DOCTYPE (Document Type Declaration) is an instruction that appears at the beginning of an HTML document, before the <html> tag.Its primary role is to tell the web browser which version of HTML the page is written in, ensuring that the browser renders the content correctly. It is not an HT
    4 min read
    HTML a Tag
    The <a> tag defines a hyperlink, which is used to link from one page to another. The most important attribute of the <a> element is the href attribute, which indicates the link's destination. This attribute determines where the user is directed upon clicking the link.HTML<a href="http
    2 min read
    HTML abbr Tag
    The <abbr> tag in HTML is used to represent abbreviations and provides additional information about them through the title attribute, which displays a tooltip when hovered over. It helps improve accessibility and SEO by offering context for the abbreviated text.It makes text clearer by explain
    3 min read
    HTML acronym Tag
    The HTML <acronym> tag was used to define an acronym, providing a way to identify and explain abbreviated terms in web content. However, it's deprecated in favor of <abbr>, which serves the same purpose but is more semantically correct.Syntax: <acronym title=""> Short Form </acr
    2 min read
    HTML < address> Tag
    The <address> tag in HTML is used to define contact information for the author or owner of a document or an article. It is typically used for information such as an address, email, or phone number.The <address> element is a block-level element by default.The content inside <address
    3 min read
    HTML applet Tag
    The applet tag in HTML was used to embed Java applets into any HTML document. The <applet> tag was deprecated in HTML 4.01, and its support has been completely discontinued starting from HTML 5. Alternatives available in HTML 5 are the <embed> and the <object> tags. Some browsers s
    2 min read
    HTML area Tag
    This <area> tag is used in an HTML document to map a portion of an image to make it clickable by the end user. This specifies the location and size of the active region on an image, which can be clicked. Clicking on areas with href attributes directs to a specified URL or action.html<!DOCTY
    3 min read
    HTML article Tag
    The HTML <article> tag defines a self-contained, independent piece of content like a blog post, news article, or comment. It is designed for content that can be independently distributed, shared, or reused, providing semantic meaning to the content.This tag is introduced in HTML5.HTML<!DOCT
    3 min read
    HTML aside Tag
    The <aside> tag is used to describe the main object of the web page more shortly like a highlighter. It 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 inform
    2 min read
    HTML5 < audio> Tag
    The <audio> tag in HTML5 is used to embed audio content on a webpage. It allows you to play audio files like MP3, OGG, or WAV directly in the browser. The <audio> element provides attributes for controlling playback, such as play, pause, and volume.Using the <source> element enable
    3 min read
    HTML b Tag
    The <b> tag in HTML is used to make the enclosed text bold, giving it greater emphasis or visual importance. Unlike the <strong> tag, which also makes text bold but with semantic importance. the <b> tag is purely for styling purposes and does not carry semantic meaning.HTML<p
    2 min read
    HTML <base> Tag
    The HTML <base> tag is used to specify a base URL, or target, for relative links. This URL will be the base URL for every link on the page and will be prefixed before each of them. For example, if the URL specified by the base tag is "www.xyz.com" then every other URL on the page will be prefi
    2 min read
    HTML <basefont> Tag
    The <basefont> tag in HTML is used to set the default text-color, font-size, font-family of all the text in the browser. It is no longer supported in HTML5. So, as an alternative, we are using CSS in the code example. The <basefont> tag was supported in Internet Explorer 9, and earlier v
    2 min read
    HTML Tags - A to Z List
    HTML Tags are fundamental elements used to structure and format content on web pages. They provide instructions to web browsers on how to render text, images, links, and other media.HTML tags are enclosed in angle brackets < > and usually come in pairs: an opening tag and a closing tag. The cl
    15+ min read

    HTML Attributes

    HTML Attributes
    HTML Attributes are special words used within the opening tag of an HTML element. They provide additional information about HTML elements. HTML attributes are used to configure and adjust the element's behavior, appearance, or functionality in a variety of ways. Each attribute has a name and a value
    8 min read
    HTML < input> accept Attribute
    The HTML <input> accept attribute is used to control the type of files that can be selected for input, restricting the file selection to specific formats such as image/* for images or .pdf for PDF files. Syntax: <input accept = "file_extension | audio/* | video/* | image/* | media_type">
    4 min read
    HTML <form> accept-charset Attribute
    The HTML <form> accept-charset attribute defines which character encoding the form will use when submitting data.By default, the accept-charset attribute is set to 'UNKNOWN,' using the same encoding as the document.It ensures the correct encoding when the form is submitted, especially for non-
    3 min read
    HTML accesskey Attribute
    The HTML accesskey attribute defines a keyboard shortcut to activate or focus an element.It assigns a keyboard key combination to trigger an element (like a link or button).Browser support and specific key combinations vary (e.g., Alt + key on Windows, Ctrl + key on macOS).Use it sparingly and provi
    3 min read
    HTML action Attribute
    The HTML action attribute is used to specify where the form data should be sent on submission. It allows the browser to send the data to the specified location, enabling server-side scripts to process the data and generate a response.Note: It can be used in the <form> element. Syntax:<form
    3 min read
    HTML align Attribute
    In HTML, the align attribute is used to control the alignment of elements on a webpage. Whether it's for text, images, or tables, the align attribute helps to position content in relation to its surrounding elements.Syntax<element_name align="left | right | center | justify">Attribute ValuesAt
    4 min read
    HTML alt attribute
    The alt attribute in HTML provides alternative text for images, aiding accessibility and providing context for screen readers.Syntax:<img src=" " alt=" " >HTML<html> <body> <h1>GeeksforGeeks Logo</h1> <img src="https://media.geeksforgeeks.org/wp-content/uploads/20190
    3 min read
    HTML | <script> async Attribute
    The HTML,<script> async attribute is a boolean attribute. When present, it specifies that the script will be executed asynchronously when it is available. This attribute only works for external scripts (and used only in when src attribute is present ).Note: There are so many ways in which exte
    1 min read
    HTML <input> autocomplete Attribute
    The HTML | <input>autocomplete Attribute is used to specify whether the input field has autocompleted and would be on or off. When the autocomplete attribute is set to on the browser will automatically complete the values based on what the user entered before. It works with many input fields s
    1 min read
    HTML < form> autocomplete Attribute
    The HTML <form> autocomplete attribute allows the browser to automatically fill the form fields based on previous user inputs.Used to save time by reusing data like names, emails, and addresses.It can be turned "on" or "off" depending on the field's requirements.Syntax<form autocomplete="on
    3 min read
    HTML autofocus Attribute
    The HTML autofocus attribute is a powerful tool that enhances user experience by automatically setting the focus to a specific element when a webpage loads. Syntax<input type="text" autofocus> Note: This attribute is boolean, meaning it can either be present or absent.Supported TagsElementPurp
    2 min read
    HTML input autofocus Attribute
    The autofocus attribute in HTML is used to specify that a particular form element (like an input field, textarea, or select dropdown) should automatically receive focus when the page is loaded, allowing the user to start interacting with it immediately without needing to click on it.Syntax<input
    1 min read
    HTML <button> autofocus Attribute
    The HTML <button> autofocus Attribute is used to specify whether the button should get automatically get focused or not when the page loads. It is a Boolean Attribute. Syntax: <button type="button" autofocus> Example: This Example illustrates the use of autofocus attribute in Button Elem
    1 min read
    HTML <textarea> autofocus Attribute
    The HTML <textarea> autofocus Attribute is used to specify that the textarea field should get automatically focus when the page loads. It is a Boolean Attribute. Syntax: <textarea autofocus> Example: This Example illustrates the use of autofocus attribute in Textarea Element. html <!D
    1 min read
    HTML Attributes Complete Reference
    HTML attributes are special words placed inside the opening tag of an HTML element to define its characteristics. Each attribute has two parts:Attribute nameAttribute value (separated by an equal sign = and enclosed in double quotes " ").Syntax:<tag_name attribute_name="value"> Contents...
    8 min read

    HTML Graphics

    HTML SVG Basics
    SVG stands for Scalable Vector Graphics. It defines vector-based graphics in XML format. SVG graphics do not lose any quality when zoomed or resized, and every element and attribute in SVG files can be animated. Advantages of SVG: The advantages of using SVG over other image formats (like JPEG and G
    4 min read
    HTML Canvas Basics
    In this article, we will know HTML Canvas Basics, and their implementation through the examples. The HTML "canvas" element is used to draw graphics via JavaScript. The "canvas" element is only a container for graphics. One must use JavaScript to actually draw the graphics. Canvas has several methods
    5 min read

    HTML APIs

    HTML Geolocation
    The HTML Geolocation is used to get the geographical position of a user. Due to privacy concerns, this position requires user approval. Geo-location in HTML5 is used to share the location with some websites and be aware of the exact location. It is mainly used for local businesses, and restaurants,
    5 min read
    HTML Drag and Drop
    Drag and Drop is a very interactive and user-friendly concept that makes it easier to move an object to a different location by grabbing it. This allows the user to click and hold the mouse button over an element, drag it to another location, and release the mouse button to drop the element there. W
    5 min read

    HTML DOM

    HTML DOM (Document Object Model)
    The HTML DOM (Document Object Model) is a programming interface that represents the structure of a web page in a way that programming languages like JavaScript can understand and manipulate. Think of it as a tree of objects where each part of your HTML document (elements, attributes, text) is repres
    6 min read
    HTML DOM activeElement Property
    The DOM activeElement property is used to return the currently active elements in the HTML document. This property is read-only. It gives the reference of a focused element object in the document. Syntax: document.activeElementReturn Value: A reference to the element object in the document that has
    2 min read
    HTML DOM anchors Collection
    The HTML DOM anchors collection is used to return the collection of all <a> elements. It only counts those <a> element that has the name attribute only. The name attribute of the anchor element does not support HTML 5. The elements in the collection are sorted that appear in the source c
    2 min read
    HTML DOM close() Method
    The DOM close() method is used to close the output stream. It is used to indicate the finish of writing on a window. The close() method does not require any parameter. Syntax:document.close()Example 1: In this example, we will use DOM close() method.HTML<!DOCTYPE html> <html> <head
    2 min read
    HTML DOM baseURI Property
    The DOM baseURI property is used to return the base Uniform Resource Identifier (URI) of the document. This property is used for read-only. This property returns a string value that represents the base URI of the page.Syntax: node.baseURIReturn Value: It returns a string value that represents the UR
    2 min read
    HTML DOM body Property
    The HTML DOM Body property is used to set the document <body> element. It only returns the content present in the <body> Tag. This property is used to change the present content inside the <body> element and sets them with the new specified content. This property does not return th
    2 min read
    HTML DOM createAttribute() Method
    This createAttribute() method is used to create an attribute with the specified name and returns the attribute object. The attribute.value property is used to set the value of the attribute and the element.setAttribute() method is used to create a new attribute for an element. This method() contains
    2 min read
    HTML DOM doctype Property
    The DOM doctype property is used to return the doctype of any HTML document. The DocumentType object is the name property used to return the name of the object. If there is no doctype declared in the document then it returns a Null value. Syntax:document.doctypeExample: In this example, we will use
    2 min read
    HTML DOM writeln() Method
    The writeln() method is used to write a document with the additional property of a newline character after each statement. This method is similar to the document.write() method. Syntax: document.writeln( exp1, exp2, exp3, ... )Parameters: This method contains many parameters which are optional. All
    1 min read
    HTML DOM console error() Method
    The console.error() method in HTML is used to display an error message on the console. The console.error() method is used for testing purposes. The error message is sent as a parameter to the console.error() method. Syntax:console.error( message )Parameters: This method accepts a single parameter me
    2 min read
    HTML DOM URL Property
    The DOM URL property in HTML is used to return a string that contains the complete URL of the current document. The string also includes the HTTP protocol such as ( http://).Syntax:document.URLReturn Value: It returns a string value that represents the full URL of the document. Example: In this exam
    2 min read
    HTML DOM embeds Collection
    The DOM embeds collection property in HTML is used to return the collection of all embedded elements. The elements in the collection are sorted that appear in the source code. This property is used for read-only. Syntax: document.embedsProperty: This property contains a value length that returns the
    3 min read
    HTML DOM console warn() Method
    The console.warn() method is used to write a warning message in the console. So open the console to display the output (warning message). Syntax:console.warn( message )Parameters: This method accepts single parameter message which is mandatory. This parameter is used to hold the warning message. Exa
    2 min read
    HTML DOM console trace() Method
    This console.trace() method is used to display the trace which represents how the code ended up at a certain point. Syntax:console.trace( label )Parameters: This method accepts a single parameter label. Example: In this example, we will use a console.trace() methodHTML<!DOCTYPE html> <html
    2 min read
    HTML DOM Complete Reference
    HTML DOM (Document Object Model) is a programming interface that represents the elements of an HTML document in a tree-like structure.Allows developers to change content and layout using JavaScript.Enables dynamic updates and user interaction on websites.Facilitates the addition, removal, or modific
    15+ min read

    HTML Audio/Video

    HTML DOM Audio Object
    The Audio object is used for representing an HTML <audio> element. The Audio Object is a new object in HTML5. Syntax: For creating an <audio> element:let gfg = document.createElement("AUDIO")For accessing an <audio> element:let x = document.getElementById("myAudio") Property Values
    4 min read
    HTML DOM Video Object
    The Video object in HTML DOM represents an <video> element. The video element can be accessed by using getElementById() method. Syntax: To access a video object: document.getElementById("videoId");where id is assigned to the <video> tag.To create a video object: document.createElement("V
    4 min read
    HTML DOM Video canPlayType( ) Method
    The Video canPlayType() method is used for checking if the browser can play the specified video type or not. The Video canPlayType method returns a string that represents the level of support. Syntax: videoObject.canPlayType(type) Parameter Values: type: It specifies the video type (and optional cod
    2 min read
    HTML DOM Audio audioTracks Property
    The Audio audioTracks Property is used for returning an AudioTrackList object. The audio tracks available for a video are represented by the AudioTrackList object. The AudioTrack Object is used to represent an available audio track. Syntax: audioObject.audioTracks Return Values: AudioTrackList Objec
    1 min read
    HTML DOM Audio autoplay Property
    The Audio autoplay property is used for setting or returning whether audio should start playing as soon as it is loaded or not. It can be used to specify that the audio should automatically start playing as soon as it is loaded. Syntax: Return the autoplay property:audioObject.autoplaySet the autopl
    2 min read
    HTML DOM Audio buffered Property
    The Audio buffered property is used for returning a TimeRanges object. The user’s buffered ranges of the audio can be represented using the TimeRanges object. The time range of buffered audio is defined by the buffered range and if the user skips in the audio, it may result in several buffered range
    2 min read
    HTML DOM Audio controls Property
    The Audio controls property is used for setting or returning whether audio should display standard audio controls or not. The <audio> controls attribute is reflected by this property. The audio controls included in the property are: PlayPauseSeekingVolume Syntax: Return the control property:au
    1 min read
    HTML DOM Audio currentSrc Property
    The Audio currentSrc property is used for returning the URL of the current audio. The Audio currentSrc property returns an empty string if no audio is specified. The Audio currentSrc property is a read-only property. Syntax: audioObject.currentSrc The below program illustrates the Audio currentSrc P
    1 min read
    HTML DOM Audio currentTime Property
    The Audio currentTime property is used for setting or returning the current position of the audio playback. The Audio currentTime property returns the audio playback position in the form of seconds. The playback jumps to the specified position when this property is set. Syntax: Return the currentTim
    2 min read
    HTML DOM Audio defaultMuted Property
    The Audio defaultMuted property is used for setting or returning whether the audio should be muted by default or not. The audio defaultMuted property cannot change the current mute state, it only affects the default muted state. Syntax: Return the deafaultMuted property:audioObject.defaultMutedSet t
    2 min read
    HTML DOM Audio defaultPlaybackRate Property
    The Audio defaultPlaybackRate property is used for setting or returning the default playback speed of the audio. The Audio defaultPlaybackRate property only changes the default playback speed, not the current playback speed. Syntax: Return the defaultPlaybackRate property:audioObject.defaultPlayback
    2 min read
    HTML DOM Audio duration Property
    The Audio duration property is used for returning the length of audio. The Audio duration property returns the value in seconds. Different browsers return different precision values such as safari returning up to 14 decimal places followed by Opera returning up to 9 decimal places. The Audio duratio
    2 min read
    HTML DOM Audio ended Property
    The Audio ended property is used for returning whether the playback of the audio has ended or not. When the playback position is at the end of the audio, we consider the audio has ended. The Audio-ended property returns a boolean true if the audio has ended, else it returns false. The Audio ended pr
    1 min read
    HTML DOM Audio loop Property
    The Audio loop property is used for setting or returning whether an audio should start playing over again when it is finished or not. Syntax: Return the loop property:audioObject.loopSet the loop property:audioObject.loop = true | false Property Values: true | false: It is used to specify whether th
    2 min read
    HTML DOM Audio/Video Complete Reference
    HTML DOM Audio/Video properties and methods allow developers to control audio and video elements programmatically.These controls include playing, pausing, stopping, and adjusting volume.DOM methods enable dynamic interaction and customization of media elements.They enhance the user experience by off
    2 min read

    HTML 5

    HTML5 | Introduction
    HTML5 is the fifth version of Hypertext Markup Language (HTML), a standard language used to structure webpages. It defines how content on a webpage should be structured and displayed. Here are some key points of HTML5Multimedia Support: Embeds audio and video without plugins.New Form Controls: Inclu
    11 min read
    HTML Spell Check
    The Spell Check feature in HTML is used to detect grammatical or spelling mistakes in the text fields.The Spell Check feature can be applied to HTML forms using the spellcheck attribute. The spellcheck attribute is an enumerated attribute that defines whether the HTML element will be checked for err
    2 min read
    HTML5 Complete Reference
    HTML (HyperText Markup Language) is the standard language used to create and design web pages. It defines the structure and layout of a webpage using a series of elements and tags.HTML5 is the latest version of HTML, bringing significant improvements for building modern web applications.It introduce
    8 min read

    HTML 5 MathML

    HTML5 MathML Introduction
    Mathematical Markup Language (MathML) is an XML-based markup language designed to represent mathematical expressions and formulas on web pages. It is an integral part of HTML5, allowing browsers to display mathematical content without the need for additional plugins or images.Importance of MathML in
    5 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 attr
    2 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 a
    2 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 att
    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,
    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
    1 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 fra
    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 li
    1 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 th
    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 </m
    2 min read
    HTML5 MathML <mmultiscripts> Tag
    The MathML <mmultiscripts> tag in HTML5 is used to create multi-dimensional matrices. The degree depends on the conditionality of a representative array. As a number/digit is a 0-dimensional array. 1st order Tensor and 2nd order tensor as a squire matrices will represent a 1-dimensional array.
    2 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
    2 min read
    HTML5 MathML <mo> Tag
    The MathML <mo> tag in HTML5 is used print operator between elements. Any kind of mathematical operator can be used by this tag. Syntax: <mo> operator </mo>Attributes: This tag accepts some attributes which are listed below: accent: This attribute is used to specifies whether the o
    3 min read
    HTML5 MathML <mover> Tag
    The HTML5 MathML <mover> tag is an inbuilt tag in HTML5. This tag is used to attach an accent or a limit over an expression. Syntax: <mover> base overscript </mover>Attributes: This tag accepts below mentioned attributes: class|id |style: This attribute holds the styles of the chil
    1 min read
    HTML5 MathML <mpadded> Tag
    The MathML <mpadded> tag in HTML5 is used to add extra padding and to set the general adjustment of position and size of enclosed contents. Syntax: <mpadded attribute="value"> </mpadded> Attributes: class|id|style: This attribute is used to hold the styles of the child elements.mat
    2 min read
    HTML5 MathML Complete Reference
    The MathML comes in HTML5. The current MathML version is 3. It was introduced in the year 2015. MathML stands for Mathematics Markup Language. It is used to represent mathematical equations or expressions in web browsers, like other HTML elements. MathML is used to describe mathematics as a basis fo
    3 min read

    HTML Course

    Introduction to HTML and CSS | Learn to Design Your First Website in Just 1 Week
    Ready to Design Your First Website in Just 1 Week? With this guide, learn how to build a simple yet stylish website in just one week to gain skills and confidence.This is an introduction course to HTML and CSS which will help you learn all about the basics of HTML and CSS needed to begin with Web De
    4 min read
    HTML Course | Structure of an HTML Document
    HTML (Hypertext Markup Language) is used in over 95% of websites and is the foundation of all web pages. It provides the basic structure and content layout. For beginners in web development, learning HTML is the essential first step. Structure of an HTML DocumentWhat is an HTML Document?HTML is a ma
    4 min read
    HTML Course | First Web Page Printing Hello World
    So far, we have already learned about the structure of an HTML document, tags, etc in the previous module. Let us use this knowledge to create our first web page.Here, we are creating a simple webpage that displays a "Hello World" message as the perfect starting point. This exercise will help you un
    2 min read
    HTML Course | Basics of HTML
    Now that you've created your first "Hello World" webpage, it's time to learn some important concepts of HTML. In this chapter, we’ll cover basic elements that add content and structure, including paragraphs, images, lists, attributes, comments, and more. Table of ContentHTML Paragraph HTML Horizonta
    6 min read
    HTML Course | Starting the Project - Creating Directories
    Now we have understood the important concepts of HTML, it's time to start building a structured web project. In this chapter, you’ll learn how to set up directories and organize files efficiently. It is important to have a well-structured directory for both small and large projects, as it makes your
    3 min read
    HTML Course | Understanding and Building Project Structure
    Now that you've already set up a basic directory structure, it's time to understand and build the basic structure of our project.Course Navigation Understanding and Building Project StructureWe have already created all of the directories needed for our project. Let's just start writing our HTML code
    3 min read
    HTML Course | Creating Navigation Menu
    A navigation menu is the first element we see in any website. It allows users to explore different pages and sections easily. In this chapter, you’ll learn how to create a navigation menu in HTML.Course Navigation HTML Course : Creating Navigation MenuIn the last chapter, we have created the entire
    6 min read
    HTML Course | Building Header of the Website
    The header is the top part of the website and the important area for branding and navigation. In this chapter, you’ll learn how to build a header with the tags which we have already learnt.Course Navigation HTML Course : Building Header of the WebsiteSo far, we have created the navigation bar for th
    4 min read
    HTML Course | Building Main Content - Section 1
    The main content of a website is where you show the core information that visitors are looking for. This could be text, images, links, or any important details about your services, products, or ideas.Course Navigation HTML Course : Building Main Content - Section 1We just completed building the head
    4 min read
    HTML Course | Building Main Content - Section 2
    In this article, we will build a three-column layout where each column describes a course and includes a "Learn More" button. Using CSS, we’ll arrange the columns side-by-side and will style them accordingly.Course Navigation HTML Course : Building Main Content - Section 2In the last chapter, we beg
    5 min read
    HTML Course | Building Main Content - Section 3
    Adding images to the card makes it more descriptive and engaging. In this section, we’ll create a four-column layout where each column has an image, a title, and a description.Course Navigation HTML course Building Main Content - Section 3In the previous article, we have seen the 3-Column layout and
    5 min read
    HTML Course | Building Footer
    In this article, we will build the footer for our website. The footer will contain information like contact details, links to social media, and additional navigation links.Course Navigation HTML Course: Building FooterSo, we have completed building all parts of our website except the footer. So, let
    6 min read
geeksforgeeks-footer-logo
Corporate & Communications Address:
A-143, 7th Floor, Sovereign Corporate Tower, Sector- 136, Noida, Uttar Pradesh (201305)
Registered Address:
K 061, Tower K, Gulshan Vivante Apartment, Sector 137, Noida, Gautam Buddh Nagar, Uttar Pradesh, 201305
GFG App on Play Store GFG App on App Store
Advertise with us
  • Company
  • About Us
  • Legal
  • Privacy Policy
  • In Media
  • Contact Us
  • Advertise with us
  • GFG Corporate Solution
  • Placement Training Program
  • Languages
  • Python
  • Java
  • C++
  • PHP
  • GoLang
  • SQL
  • R Language
  • Android Tutorial
  • Tutorials Archive
  • DSA
  • Data Structures
  • Algorithms
  • DSA for Beginners
  • Basic DSA Problems
  • DSA Roadmap
  • Top 100 DSA Interview Problems
  • DSA Roadmap by Sandeep Jain
  • All Cheat Sheets
  • Data Science & ML
  • Data Science With Python
  • Data Science For Beginner
  • Machine Learning
  • ML Maths
  • Data Visualisation
  • Pandas
  • NumPy
  • NLP
  • Deep Learning
  • Web Technologies
  • HTML
  • CSS
  • JavaScript
  • TypeScript
  • ReactJS
  • NextJS
  • Bootstrap
  • Web Design
  • Python Tutorial
  • Python Programming Examples
  • Python Projects
  • Python Tkinter
  • Python Web Scraping
  • OpenCV Tutorial
  • Python Interview Question
  • Django
  • Computer Science
  • Operating Systems
  • Computer Network
  • Database Management System
  • Software Engineering
  • Digital Logic Design
  • Engineering Maths
  • Software Development
  • Software Testing
  • DevOps
  • Git
  • Linux
  • AWS
  • Docker
  • Kubernetes
  • Azure
  • GCP
  • DevOps Roadmap
  • System Design
  • High Level Design
  • Low Level Design
  • UML Diagrams
  • Interview Guide
  • Design Patterns
  • OOAD
  • System Design Bootcamp
  • Interview Questions
  • Inteview Preparation
  • Competitive Programming
  • Top DS or Algo for CP
  • Company-Wise Recruitment Process
  • Company-Wise Preparation
  • Aptitude Preparation
  • Puzzles
  • School Subjects
  • Mathematics
  • Physics
  • Chemistry
  • Biology
  • Social Science
  • English Grammar
  • Commerce
  • World GK
  • GeeksforGeeks Videos
  • DSA
  • Python
  • Java
  • C++
  • Web Development
  • Data Science
  • CS Subjects
@GeeksforGeeks, Sanchhaya Education Private Limited, All rights reserved
We use cookies to ensure you have the best browsing experience on our website. By using our site, you acknowledge that you have read and understood our Cookie Policy & Privacy Policy
Lightbox
Improvement
Suggest Changes
Help us improve. Share your suggestions to enhance the article. Contribute your expertise and make a difference in the GeeksforGeeks portal.
geeksforgeeks-suggest-icon
Create Improvement
Enhance the article with your expertise. Contribute to the GeeksforGeeks community and help create better learning resources for all.
geeksforgeeks-improvement-icon
Suggest Changes
min 4 words, max Words Limit:1000

Thank You!

Your suggestions are valuable to us.

What kind of Experience do you want to share?

Interview Experiences
Admission Experiences
Career Journeys
Work Experiences
Campus Experiences
Competitive Exam Experiences