HTML Cheat Sheet
Document Structure:
Essential Tags:
<html>
: Root element of an HTML page.<head>
: Contains meta-information about the document.<title>
: Specifies the title of the document.<body>
: Contains the content of the HTML document.<meta>
: Specifies metadata about the HTML document.
Text Formatting
<h1>
to<h6>
: Header tags,<h1>
being the most important, and<h6>
the least.<p>
: Paragraph tag.<br>
: Line break.<hr>
: Thematic break in the page.<strong>
/<b>
: Bold text.<em>
/<i>
: Italicized text.<u>
: Underlined text.<sup>
: Superscript text.<sub>
: Subscript text.
Hyperlinks and Images
<a href="url">link text</a>
: Creates a hyperlink.<img src="url" alt="alternative text">
: Embeds an image.
Lists
- Unordered List:
- Ordered List:
Tables
Forms
Useful Attributes
id
: Defines a unique id for an element.class
: Defines one or more class names for an element.style
: Applies CSS styles directly to the element.title
: Adds extra information about an element (usually shown as a tooltip).
CSS Integration
<link rel="stylesheet" href="styles.css">
JavaScript Integration
<script src="script.js"></script>
Tips for Better HTML Coding
<header>
, <footer>
, <article>
, etc.) to enhance SEO and accessibility.This HTML cheat sheet provides a quick overview of the essential HTML elements and their use.
Keep it handy to refer to as you build or maintain web pages.
Master Frontend by choosing your ideal learning course
View all courses
Introduction to HTML and CSS
4.3
Learn the essentials of frontend development, from browser functionality to building modern responsive websites and real-life applications.
5 projects
4K already learning
Frontend Developer
4.4
Master core web development concepts and the popular tool suite, JavaScript, HTML, and CSS to create your own websites and apps.
22 projects
63K already learning