Main Content
- Main (
<main>):Represents the dominant content of the
<body>of a document.Example:
2026-10-05
HTML: The Building Blocks of the Web
HTML stands for HyperText Markup Language.
Key Points:
<p>This is a paragraph.</p><h1> and </h1><ul><li>Item 1</li><li>Item 2</li></ul><img src="image.jpg" alt="Description">This is a simple web page created using HTML.
<!DOCTYPE>, <html>, <head>, and <body> tags.<!DOCTYPE html>:
<html>:
<html lang="en">lang attribute specifies the language of the document.<head><head>:The <head> section of an HTML document contains meta-information about the document, such as its title, character encoding, and links to external resources like stylesheets.
<meta charset="UTF-8">: Specifies the character encoding.<meta name="viewport" content="width=device-width, initial-scale=1.0">: Ensures responsive design.<meta name="description" content="A simple HTML example">: Provides a description for search engines.<title>: Sets the title of the document, displayed in the browser tab.<link rel="stylesheet" href="styles.css">: Links to an external CSS file.<body>The <body> section of an HTML document contains all the content that is displayed to the user, such as headings, paragraphs, images, and links.
This is a simple HTML page to demonstrate the structure of a web document.
<h1>, <h2>, <h3>, <h4>, <h5>, <h6>
<h1> is the main heading, and <h6> is the least important heading.<p>
Use the target="_blank" attribute to open the link in a new tab.
Example:
Use the mailto: scheme in the href attribute to create a link that opens the user’s email client.
Example:
Use the tel: scheme in the href attribute to create a link that initiates a phone call on supported devices.
Example:
<img>
src attribute to specify the image’s source.alt attribute to provide an alternative text description for accessibility.Organizing Data with HTML Tables
HTML tables are used to present data in a structured format, with rows and columns. They are often used for displaying tabular information such as schedules, data comparisons, or product catalogs.
Key Elements:
<table>: Defines the table.<thead>: Contains the table header row.<tr>: Defines a table row.<th>: Defines a table header cell.<tbody>: Contains the table body rows.<td>: Defines a table data cell.| Product Name | Price | Quantity |
|---|---|---|
| Laptop | $999 | 10 |
| Smartphone | $799 | 20 |
| Tablet | $499 | 15 |
colspan: Specifies how many columns a cell should span.rowspan: Specifies how many rows a cell should span.border: Sets the width of the table border.| Header 1 | Header 2 | |
|---|---|---|
| Row 1, Cell 1 | Row 1, Cell 2 | |
| Row 2, Cell 1 (spans 3 columns) | ||
<ul>):
Creates a list of items with bullet points.
Example:
<ol>):
Creates a list of items with numbers.
Example:
<li>):
<div>):
Group elements together for styling or layout purposes.
No semantic meaning.
Example:
<header>):
Contain page-level navigation or branding.
Example:
<footer>):
Contain page-level information, such as copyright or contact details.
Example:
<main>):
Represents the dominant content of the <body> of a document.
Example:
<section>):
Represents a standalone section of content.
Example:
<article>):
Represents a self-contained composition in a document, page, or site.
Example:
<aside>):
Represents content that is tangentially related to the content around it.
Example:
<nav>):
Represents a section of a page that links to other pages or to parts within the page.
Example:
<figure>):
Represents self-contained content, such as illustrations, diagrams, photos, code listings, etc.
Example:
<figcaption>):
Represents a caption or legend for a figure.
Example:
<summary>):
Represents a summary, caption, or legend for the content of a <details> element.
Example:
<details>):
Represents a disclosure widget from which the user can obtain additional information or controls.
Example:
<header>, <main>, <section>, <article>, <footer>.Provide information about the document.
Examples:
Use descriptive and keyword-rich content.
Examples:
E. Bruno - HTML Fundamentals