HTML Essentials

A comprehensive guide to essential HTML tags and elements

Introduction to HTML

HTML (HyperText Markup Language) is the standard markup language for documents designed to be displayed in a web browser. It defines the structure and content of web pages.

Text Elements

Headings

HTML provides six levels of headings, from <h1> (most important) to <h6> (least important).

This is an h1 heading

This is an h2 heading

This is an h3 heading

This is an h4 heading

This is an h5 heading
This is an h6 heading

Paragraphs and Text Formatting

The <p> tag defines a paragraph. HTML also provides various elements for text formatting:

This is a regular paragraph.

This paragraph contains strong (bold) text and emphasized (italic) text.

also contains bold text, italic text and underline text

Lists

Unordered Lists

Unordered lists use the <ul> tag and list items with <li>:

  • HTML
  • CSS
  • JavaScript

Ordered Lists

Ordered lists use the <ol> tag:

  1. Learn HTML
  2. Learn CSS
  3. Learn JavaScript

Nested Lists

Lists can be nested within each other:

  • Frontend Development
    • HTML
    • CSS
    • JavaScript
  • Backend Development
    • Node.js
    • Python
    • PHP

Media Elements

Images

Images are added using the <img> element:

Orange tabby kitten
Orange tabby kitten

Audio

Audio can be embedded using the <audio> element:

Note: This is a placeholder. In a real application, you would provide an actual audio file.

Video

Videos can be embedded using the <video> element:

Note: This is a placeholder. In a real application, you would provide an actual video file.

Iframe

The <iframe> element can embed another HTML page within the current page:

Note: This is a placeholder iframe. In a real application, you would provide an actual URL.

Forms

Form Elements

Forms are created using the <form> element and can contain various input types:

Personal Information
Preferences

Experience Level:

Interested in:

Additional Information

Tables

Basic Table Structure

Tables are created using <table>, <tr> (table row), <th> (table header), and <td> (table data):

Popular Programming Languages
Language Created Primary Use
JavaScript 1995 Web Development
Python 1991 Data Science, AI
Java 1995 Enterprise Applications
Data as of 2023

Semantic HTML

Semantic Elements

Semantic HTML elements clearly describe their meaning to both the browser and the developer:

  • <header> - Represents introductory content or a set of navigational links
  • <nav> - Represents a section of navigation links
  • <main> - Represents the main content of the document
  • <section> - Represents a standalone section
  • <article> - Represents a self-contained composition
  • <aside> - Represents content tangentially related to the content around it
  • <footer> - Represents a footer for a section or page

Why Use Semantic HTML?

Using semantic HTML improves:

  • Accessibility - Screen readers can better understand the content
  • SEO - Search engines can better understand your content
  • Maintainability - Code is more readable and easier to maintain
  • Reusability - Consistent structure makes styling easier

Special Characters

HTML Entities

HTML entities are used to display reserved characters and special symbols:

  • < - Less than (&lt;)
  • > - Greater than (&gt;)
  • & - Ampersand (&amp;)
  • " - Double quote (&quot;)
  • ' - Single quote (&apos;)
  • © - Copyright symbol (&copy;)
  • ® - Registered trademark (&reg;)
  • ™ - Trademark (&trade;)
  • € - Euro sign (&euro;)
  • £ - Pound sign (&pound;)
  • ¥ - Yen sign (&yen;)
  •   - Non-breaking space (&nbsp;)