T E C h O C E A N H U B

Basic document structure in html

In HTML (Hypertext Markup Language), the basic structure of a document is defined using a set of tags. Here’s an example of a basic HTML document structure:

<!DOCTYPE html>
<html>
<head>
  <title>Page Title</title>
</head>
<body>
  <h1>Heading 1</h1>
  <p>This is a paragraph.</p>
</body>
</html>

Let’s break down the structure:

  1. <!DOCTYPE html>: This declaration specifies the version of HTML being used, which is HTML5 in this case.
  2. <html>: The root element of an HTML document. All other elements are contained within this tag.
  3. <head>: This section contains meta-information about the document, such as the title and linking to external stylesheets or scripts. It is not displayed on the web page.
  4. <title>: This tag is used to specify the title of the document, which appears in the browser’s title bar or tab.
  5. <body>: The main content of the HTML document is placed within this tag. It contains all the visible elements displayed in the web page.
  6. <h1>: A heading element. It represents the main heading of the page and is displayed in a larger font size by default.
  7. <p>: A paragraph element. It is used to define a paragraph of text.

You can add more HTML elements within the <body> tag to structure and organize your content further.

Copyright ©TechOceanhub All Rights Reserved.