Chapter 3: Basic HTML Tags

We can add elements inside the body tag to define the page layout.

HTML Element

An HTML element consists of everything from the starting tag to the ending tag.

HTML Attributes

HTML attributes are used to add more information corresponding to an HTML tag.

Example:

We can either use single or double quotes in attributes.

The Heading Tag

Heading tag is used to mark headings in HTML. From h1 to h6, we have tags for the most important to the least important heading.

Note: We should not use HTML headings to make theck or bold.

The Paragraph Tag

Paragraph tags are used to add paragraph to an HTML page.

The Anchor Tag

The Anchor Tag is used to add links to an existing content inside an HTML page.

The Image Tag

<img> tag is used to add images in an HTML page.

Bold, Italic and Underline Tags

We can use bold, italic and underline tags to highlight the text as follows:

BR Tag

The <br> tag is used to create line breaks in an HTML document. Closing tag is not required for this tag.

Big and Small Tags

We can make text a bit larger and a bit smaller using <big> and <small> tags respectively.

HR Tag

The <hr> tag in HTML is used to create a horizontal ruler often used to separate the content. Closing tag is not required for this tag.

Subscript and Superscript

Imagine how we can write H2SO4 or 82 = 64 or text is in subscript or text is in superscript ?



Pre Tag

HTML always ignores extra spaces and newlines. In order to display a piece of text as is, we use pre tag.