HTML (HyperText Markup Language) is the standard language for creating web pages. It uses elements (tags) to describe the structure and meaning of content.
<!DOCTYPE html>
<html>
<head>
<title>Page</title>
</head>
<body>
<h1>Hello</h1>
<p>Paragraph text.</p>
</body>
</html>
HTML: Original, forgiving syntax.
XHTML: XML-based, strict rules (must be well-formed).
HTML5: Modern spec with semantic tags, multimedia APIs, canvas, storage, and more.
Tags are element names wrapped in <> (e.g., <p>). Attributes provide extra information (e.g., class, id, src).
<img src="cat.jpg" alt="Cute cat">
Block-level elements (e.g., <div>, <p>) take full width and start on a new line. Inline elements (e.g., <span>, <a>) flow within a line.
<div> is block-level (layout container). <span> is inline (wrap small bits of content).
Semantic elements (like <article>, <nav>, <header>) express meaning — improving accessibility, SEO, and maintainability.
<strong> indicates importance (semantic). <b> is presentational (bold) without semantic emphasis.
<em> indicates emphasis (semantic). <i> is typically for italics/presentation or alternate voice.
Elements that don't have content or closing tags: <img>, <br>, <hr>, <input>, <meta>, <link>.
HTML defines structure and content; CSS defines presentation (layout, colors, fonts).
⬅ Home