Fiero Code

HTML Cheat Sheet

Common HTML tags, and what each one does.

Use the links to jump to a group, or search the page for a tag name.

Structure & Document Setup

<!DOCTYPE html>
Declares the document type as HTML5.
<html>
The root element that wraps all HTML content.
<head>
Contains metadata (not displayed on the page).
<title>
Sets the page's title (shown in browser tab).
<meta>
Provides metadata (charset, viewport, description, etc.).
<link>
Connects external resources like CSS.
<style>
Embeds CSS styles inside the page.
<script>
Embeds or links JavaScript.
<body>
Contains all visible page content.

Text & Content

<h1> to <h6>
Headings, <h1> is largest and most important.
<p>
Paragraph of text.
<span>
Inline container, useful for styling part of text.
<br>
Line break.
<hr>
Horizontal rule (thematic break/line).

Grouping & Layout

<div>
Block-level container for grouping content.
<section>
Defines a thematic section of the page.
<article>
Represents independent, self-contained content.
<header>
Defines introductory content or navigation.
<footer>
Defines footer content (credits, links, etc.).
<nav>
Contains navigation links.
<main>
Represents the main content of the page.
<aside>
Defines content related to the main content (like a sidebar).

Lists

<ul>
Unordered list (bullets).
<ol>
Ordered list (numbers).
<li>
List item (inside <ul> or <ol>).
<dl>
Definition list.
<dt>
Term in a definition list.
<dd>
Description of a term.

Text Formatting

<b> / <strong>
Bold text; <strong> adds semantic importance.
<i> / <em>
Italic text; <em> adds emphasis.
<u>
Underlined text.
<mark>
Highlighted text.
<small>
Smaller text.
<sup>
Superscript text (e.g., x²).
<sub>
Subscript text (e.g., H₂O).
<code>
Displays inline code.
<pre>
Preformatted text, keeps spaces/line breaks.
<blockquote>
Block quote for longer quotations.
<q>
Inline quotation.

Tables

<table>
Defines a table.
<tr>
Table row.
<td>
Table cell (data).
<th>
Table header cell (bold & centered by default).
<thead> / <tbody> / <tfoot>
Group table sections.
<caption>
Title for the table.

Forms & Input

<form>
Container for user input controls.
<input>
General input field (text, number, checkbox, etc.).
<textarea>
Multi-line text input.
<button>
Clickable button.
<select>
Dropdown menu.
<option>
Option inside a dropdown.
<label>
Label for a form element.
<fieldset>
Groups related form inputs.
<legend>
Caption for a fieldset.

Semantic & Miscellaneous

<abbr>
Defines an abbreviation with a tooltip.
<cite>
Reference to a creative work.
<address>
Contact information.
<time>
Represents a date or time.
<details>
Expandable/collapsible content.
<summary>
Summary heading for <details>.

These tags are part of Fiero Code.