Basic structure of an HTML document

0
3كيلو بايت

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
البحث
الأقسام
إقرأ المزيد
التعليم
S.4 PHYSICAL EDUCATION MOCK EXAM
https://acrobat.adobe.com/id/urn:aaid:sc:EU:ec617028-2a6c-4082-b406-54df86b57b55
بواسطة Landus Mumbere Expedito 2024-07-24 19:32:08 0 3كيلو بايت
Computer Programming
Adding comments in HTML (<!-- comment -->)
While global attributes can be applied to any HTML element, some attributes are specific to...
بواسطة HTML PROGRAMMING LANGUAGE 2024-08-15 01:50:21 0 2كيلو بايت
التعليم
VLOOKUP FUNCTIONS
VLOOKUP is a powerful function in Excel that allows you to search for a value in a table and...
بواسطة Microsoft Excel 2024-09-23 20:04:52 0 3كيلو بايت
Computer Programming
Keywords, Multiple Output, and Documentation
1. Keywords: Keywords are reserved words in Python that have special meanings. They cannot...
بواسطة Python for Everybody - Full University Python Course Code 2024-07-17 14:56:53 0 3كيلو بايت
Technology
INDEX and MATCH Functions
The combination of INDEX and MATCH functions in Excel is a powerful way to perform lookups. This...
بواسطة Microsoft Excel Tips 2024-10-16 01:02:42 0 3كيلو بايت