Basic structure of an HTML document

0
9χλμ.

An HTML document is composed of two main sections: the head and the body.

The <head> Section

The <head> section contains metadata about the document, which is information about the document itself rather than content that will be displayed on the page. This includes:

  • Title: Defines the title of the document, which appears in the browser's title bar.
  • Meta tags: Provide additional information about the document, such as keywords, description, author, and character encoding.
  • Links to external stylesheets: Connect to CSS files for styling the page.
  • Scripts: Include JavaScript files for interactive elements.

HTML
<head>
  <title>My Web Page</title>
  <meta charset="UTF-8">
  <link rel="stylesheet" href="styles.css">
</head>

The <body> Section

The <body> section contains the visible content of the page, including:

  • Headings: Define the structure and importance of content (<h1> to <h6>).
  • Paragraphs: Contain regular text content (<p>).
  • Images: Display images (<img>).
  • Links: Create hyperlinks to other pages or resources (<a>).
  • Lists: Organize content into bulleted or numbered lists (<ul>, <ol>).
  • Divisions: Group content for styling or scripting purposes (<div>).

HTML
<body>
  <h1>Welcome to My Page</h1>
  <p>This is a paragraph.</p>
  <img src="image.jpg" alt="An image">
  <a href="https://example.com">Visit Example</a>
</body>

Complete HTML Structure

HTML
<!DOCTYPE html>
<html>
<head>
  <title>My Web Page</title>
  <meta charset="UTF-8">
</head>
<body>
  </body>
</html>

  • <!DOCTYPE html>: This declaration specifies the document type as HTML5.
  • <html></html>: This is the root element of an HTML document.

Note: While this is a basic structure, HTML offers many more elements and attributes to create complex and interactive web pages.

Love
1
Αναζήτηση
Κατηγορίες
Διαβάζω περισσότερα
Computer Programming
Operators and Precedence Rules
In Python, operators are special symbols that perform operations on operands (values or...
από Tebtalks Access 2024-07-16 21:44:34 1 9χλμ.
Εκπαίδευση
Interactive Learning Boosts Retention by 75%
Did You Know? Interactive Learning Boosts Retention by 75%! Engage with Your Studies and See the...
από ALAGAI AUGUSTEN 2024-07-21 19:12:20 0 17χλμ.
Chemistry
UCE CHEMISTRY PAPER 1 KAMTEC MOCK 2024
UCE CHEMISTRY PAPER 1KAMTEC MOCK 2024
από Landus Mumbere Expedito 2024-08-11 11:39:15 3 10χλμ.
Technology
POSSIBLE CHALLENGES FACED WHEN USING THE NETWORKS
Using a computer network presents several challenges that can impact performance, security, and...
από ALAGAI AUGUSTEN 2024-07-17 17:31:43 0 10χλμ.
Physics
SEPTA-O-LEVEL PHYSICS SEMINAR SLATED FOR 23RD JUNE 2024 AT ST. JOSEPH OF NAZARETH HIGH SCHOOL KAVULE-KATENDE
https://acrobat.adobe.com/id/urn:aaid:sc:EU:39c1aa82-237a-43bf-ba1a-fbe5223d26f1
από Question Bank 2024-07-14 19:52:41 2 14χλμ.
Tebtalks https://forum.tebtalks.com