What is HTML?

HTML (HyperText Markup Language) is the standard markup language for creating web pages and web applications. It defines the structure and content of web documents using a system of tags and attributes.

Quick Facts

Full NameHyperText Markup Language
Created1991 by Tim Berners-Lee
SpecificationOfficial Specification

How It Works

HTML was created by Tim Berners-Lee in 1991 as part of the World Wide Web project at CERN. It uses a tag-based syntax where elements are enclosed in angle brackets (< >). HTML documents consist of nested elements that define the document structure, including headings, paragraphs, links, images, and forms. HTML5, the current version, introduced semantic elements, native audio/video support, canvas for graphics, and APIs for offline storage and geolocation. HTML works together with CSS for styling and JavaScript for interactivity.

Key Characteristics

  • Tag-based markup syntax with opening and closing tags
  • Hierarchical document structure (DOM)
  • Semantic elements for meaningful content structure
  • Supports multimedia (images, audio, video)
  • Form elements for user input
  • Hyperlinks for navigation between documents

Common Use Cases

  1. Web page structure and content
  2. Web application interfaces
  3. Email templates (HTML email)
  4. Documentation and technical writing
  5. Progressive web applications

Example

loading...
Loading code...

Frequently Asked Questions

What is the difference between HTML and HTML5?

HTML5 is the latest version of HTML, introducing semantic elements (header, nav, article, section, footer), native audio/video support, canvas for graphics, form improvements, and APIs for geolocation, local storage, and offline applications. HTML5 also simplified the doctype to <!DOCTYPE html> and is more forgiving of syntax errors.

What are semantic HTML elements and why are they important?

Semantic elements clearly describe their meaning to both browsers and developers. Examples include <header>, <nav>, <main>, <article>, <section>, and <footer>. They improve accessibility for screen readers, help search engines understand content structure, make code more maintainable, and provide meaningful document outlines.

What is the difference between <div> and <span> elements?

<div> is a block-level element that takes up the full width available and starts on a new line, used for grouping larger sections of content. <span> is an inline element that only takes up as much width as necessary and doesn't start a new line, used for styling small portions of text within other elements.

Why do I need the DOCTYPE declaration in HTML?

The DOCTYPE declaration (<!DOCTYPE html>) tells the browser which version of HTML the page is using, ensuring it renders in standards mode rather than quirks mode. Without it, browsers may render pages inconsistently. In HTML5, the declaration is simplified to just <!DOCTYPE html>.

What is the purpose of the alt attribute in image tags?

The alt attribute provides alternative text for images when they cannot be displayed, are loading, or are being read by screen readers. It's essential for accessibility, helps with SEO, and displays when images fail to load. Good alt text should describe the image content and purpose concisely.

Related Tools

Related Terms

Related Articles