HTML(Hypertext Markup Language)

HTML is used to structure web pages using elements like headings, paragraphs, links, and images. HTML is the standard markup language for creating web pages, utilizing tags to define elements such as headings , paragraphs, lists , links , images , tables , and forms. The advent of HTML5 introduced semantic elements like header, nav, article, section, and footer, which enhance content organization, accessibility, and search engine optimization (SEO). HTML5 also supports multimedia elements like video, audio, a canvas for graphics, and APIs for features like geolocation, drag-and-drop, and local storage. HTML is widely used for static websites, web forms, landing pages, and as a foundation for dynamic applications when paired with JavaScript. Its versatility makes it indispensable in web development.

How HTML Works

HTML uses tags wrapped in angle brackets to label content. Most tags come in pairs: an opening tag marks where something starts and a closing tag (with a forward slash) marks where it ends. The opening tag, the content, and the closing tag together form an element. Some elements are self-closing because they have no content to wrap — <img> just points to a file, <br> just creates a line break.

Attributes give extra information to a tag, written inside the opening tag as name="value" pairs. A link without href has nowhere to go. An image without src has no file to display. An image without alt is invisible to screen readers. Attributes turn a generic tag into something specific and meaningful.

Nesting means placing elements inside other elements. A list element <ul> contains list items <li>. A navigation section <nav> contains links <a>. This nesting builds a tree structure called the DOM (Document Object Model) that JavaScript can later access and modify.

HTML5 introduced semantic elements whose names describe their purpose: <header>, <nav>, <main>, <article>, <section>, <aside>, <footer>. Using these instead of generic <div> tags makes code easier to read, improves accessibility for screen readers, and helps search engines understand the page structure.

Example HTML Document

<!DOCTYPE html>
<html>
<body>

<h1> Hello World </h1>
<p> This is a paragraph </p>

</body>
</html>

Live Demo

This is a Heading

This is a paragraph created using HTML.

Learn More