HTML5 is the latest version of HTML, the language used to structure content on the web. It brings many improvements and new features, making it easier to create dynamic and interactive websites and web applications.
<header>
, <footer>
, <article>
, <section>
help structure the content meaningfully.<audio>
and <video>
tags for embedding multimedia content without the need for third-party plugins like Flash.<canvas>
element allows for drawing graphics and animations. HTML5 also supports scalable vector graphics (SVG) for creating resolution-independent graphics.localStorage
and sessionStorage
to store data on a user's device, allowing for offline functionality.<input type="date">
, <input type="email">
, and <input type="range">
provide more functionality in forms.HTML4: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
HTML5: <!DOCTYPE html>
(simpler and cleaner)
HTML4: Relied on generic elements like <div>
and <span>
for structuring content.
HTML5: Introduced new semantic tags like <header>
, <footer>
, <article>
, and <section>
for better content structuring.
HTML4: Relied on plugins like Flash to display multimedia content.
HTML5: Native support for multimedia with <audio>
and <video>
tags.
HTML4: Limited input types like <input type="text">
and <input type="password">
.
HTML5: New input types like <input type="date">
, <input type="email">
, and <input type="range">
.
HTML4: Minimal API support, required external libraries for advanced functionality.
HTML5: Built-in support for advanced APIs like Geolocation, Web Storage, and WebSockets.