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).
Links & Media
<a>- Creates a clickable link that opens in a new tab.
<img>- Embeds an image with alternative text for accessibility.
<video>- Embeds a video with play/pause controls.
<audio>- Embeds audio with play/pause controls.
<iframe>- Embeds another webpage inside your page.
<a href="https://www.example.com" target="_blank">Visit Example</a>Think of it like adding a door to another website.
<img src="puppy.jpg" alt="A cute puppy" width="300" height="200">It's like pasting a picture into your page. The alt is a backup description if the picture doesn't load.
<video controls width="400">
<source src="movie.mp4" type="video/mp4">
Your browser does not support the video tag.
</video>Think of it like dropping a mini video player right on the page.
<audio controls>
<source src="song.mp3" type="audio/mpeg">
Your browser does not support the audio element.
</audio>It's like adding a music player so visitors can listen to a sound or song.
<iframe src="https://www.wikipedia.org" width="600" height="400" style="border:1px solid black;">
</iframe>Imagine a window on your page that shows another site inside it.
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.
