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
Поиск
Категории
Больше
Technology
SUMIFS Function
The SUMIFS function in Excel is used to sum a range of values based on multiple criteria. It's...
От Microsoft Excel Tips 2024-10-16 01:05:32 0 16Кб
Technology
Understanding Trojan Horses
A Trojan Horse, or simply a Trojan, is a type of malicious software that disguises itself as a...
От ALAGAI AUGUSTEN 2024-07-13 17:36:01 0 11Кб
Chemistry
UTEB MOCK CHEMISTRY PAPER 1 2024
UTEB MOCK CHEMISTRY PAPER 1 2024
От Landus Mumbere Expedito 2024-08-03 15:32:50 0 10Кб
Technology
Information Systems and Business Strategy
Information Systems (IS): These are integrated sets of components for collecting, storing,...
От Business Information Systems (BIS) Course 2024-08-01 17:03:22 0 14Кб
Technology
Cybersecurity
Cybersecurity involves protecting computer systems, networks, and data from digital attacks,...
От ALAGAI AUGUSTEN 2024-07-15 18:06:32 0 12Кб
Talksphare https://talksphare.com