HTML Basic tags - 12 Tags and its Attributes (Reference)

Tech:
Html
Since:
1 year ago
Views:
8

HTML web page is made up of different elements. In HTML, there are some tags which are used to create a basic structure of the web page.

<!DOCTYPE>

Defines the document type. Declaration is NOT case sensitive.

<!DOCTYPE html>

<!-- Commnent -->

Defines a comment.

<!-- Some commnent -->

<html>

Defines an HTML document.

<html>
  // Code
</html>

<head>

Contains metadata/information for the document.

<html>
  <head>
    // Some content
  </head>
</html>

<body>

Defines the document's body.

<body>
  // Content
</body>

<title>

Defines a title for the document and it Should be placed inside head tag.

<title>Some title</title>

<meta>

Defines metadata about an HTML document and it Should be placed inside head tag. Attributes - charset, content, http-equiv, name.

<meta charset="UTF-8" />
<meta name="description" content="Some text" />
<meta name="keywords" content="Some text,Some text,Some text" />
<meta name="author" content="Some Text" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />

<base>

Specifies the base URL/target for all relative URLs in a documentt inside head tag. Attributes - href, target.

<base href="Some_path" target="_blank" />

<h1> to <h6>

Defines HTML headings.

<h1>Some text</h1>
<h2>Some text</h2>
<h3>Some text</h3>
<h4>Some text</h4>
<h5>Some text</h5>
<h6>Some text</h6>

<p>

Defines a paragraph.

<p>
  Some paragraph content
</p>

<br>

Inserts a single line break.

<br />

<hr>

Defines a thematic change in the content. It Insert a horizontal line.

<hr />