Techoceanhub logo

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.

Share:

Categories

Archives

Related Posts

Array Destructuring

Array Destructuring Array destructuring is a powerful syntax introduced in ES6 that allows you to unpack elements from an array

Read More »

Explore our Affiliated partner links

hostgator website plan

Hostgator

Best Website hosting plans & Best for 24/7 support.

hostinger webhosting plan

Hostinger

Reasonable website hosting packages for small business & 24/7 Email support

Elementor pro

Design Worpdress website quickly using Elementor Builder and AI

buy elementor website templates

Buy Elementor Website Template

Buy ready made Elementor Website Template from us & Get Free Elementor pro licence for 1 year .