Reference Guide

Quick reference for HTML, CSS, and JavaScript syntax, properties, and methods

HTML Document Structure

Basic structure of an HTML document with DOCTYPE, html, head, and body elements.

Structuredocumentbasicstructure

Syntax

<!DOCTYPE html><html><head></head><body></body></html>

Example

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Page Title</title>
</head>
<body>
    <h1>Hello World!</h1>
</body>
</html>
Heading Elements

HTML heading elements from h1 to h6 for creating document structure.

Textheadingtextstructure

Syntax

<h1>Heading 1</h1> to <h6>Heading 6</h6>

Example

<h1>Main Title</h1>
<h2>Section Title</h2>
<h3>Subsection Title</h3>
<h4>Sub-subsection Title</h4>
<h5>Minor Heading</h5>
<h6>Smallest Heading</h6>
Anchor Element

Create links to other pages, files, email addresses, or locations within the same page.

Navigationlinkanchornavigation

Syntax

<a href="URL">Link text</a>

Example

<a href="https://example.com">External Link</a>
<a href="/page.html">Internal Link</a>
<a href="mailto:user@example.com">Email Link</a>
<a href="#section">Anchor Link</a>
<a href="file.pdf" download>Download Link</a>
Form Elements

HTML form elements for user input including input, textarea, select, and button.

Formsforminputuser-input

Syntax

<form><input type="text" name="field"></form>

Example

<form action="/submit" method="post">
    <input type="text" name="username" placeholder="Username">
    <input type="email" name="email" placeholder="Email">
    <textarea name="message" placeholder="Message"></textarea>
    <select name="country">
        <option value="us">United States</option>
        <option value="uk">United Kingdom</option>
    </select>
    <button type="submit">Submit</button>
</form>