dsabyte

Sun Aug 14 2022 (1 month ago)

Author of the @dsabyte

We are a community of software engineers.

Basics HTML structure

The HyperText Markup Language or HTML is the standard markup language for documents designed to be displayed in a web browser. HTML has a structure for elements representation.

What is HTML?

  • HTML stands for Hyper Text Markup Language

  • HTML is the standard markup language for creating Web pages

  • HTML describes the structure of a Web page

  • HTML consists of a series of elements

  • HTML elements tell the browser how to display the content

  • HTML elements label pieces of content such as "this is a heading", "this is a paragraph", "this is a link", etc.

Basic HTML document structure

<!DOCTYPE html>
<html>
   <head>
      <title>Page Title</title>
   </head>
   <body>
      <h1>My First Heading</h1>
      <p>My first paragraph.</p>
   </body>
</html>

<!DOCTYPE html>

A document type declaration, or DOCTYPE, is an instruction that associates a particular XML or SGML or HTML document with a document type definition. In the serialized form of the document, it manifests as a short string of markup that conforms to a particular syntax.

head

The <head> element is a container for metadata (data about data) and is placed between the <html> tag and the <body> tag.

Metadata is data about the HTML document. Metadata is not displayed.

Metadata typically defines the document title, character set, styles, scripts, and other meta information.

The following elements can go inside the <head> element:

  • <title> (required in every HTML document)

  • <style>

  • <base>

  • <link>

  • <meta>

  • <script>

  • <noscript>

title

The <title> HTML element defines the document's title that is shown in a browser's title bar or a page's tab. It only contains text; tags within the element are ignored.

Ex:

<title>This post is all about structure of an HTML doc...</title>

body

The <body> HTML element represents the content of an HTML document. There can be only one <body> element in a document.

Demo

SoftwareSoftware EngineeringHTMLCSSJavaScript

Comments (0)

Discussions (0)


© 2021 dsabyte. All rights reserved