text

Headings

HTML has six “levels” of headings:

1-< h1 > is used for main headings.

2-< h2 > is used for subheadings.

3- If there are further sections under the subheadings then the < h3 > element is used, and so on…

heading

Paragraphs

< p >

To create a paragraph, surround the words that make up the paragraph with an opening < p > tag and closing < /p > tag.

Bold & Italic

< b >

By enclosing words in the tags < b > and < /b > we can make characters appear bold.

< i >

By enclosing words in the tags < i > and < /i > we can make characters appear italic.

Superscript & Subscrip

< sup >

The < sup > element is used to contain characters that should be superscript such as the suffixes of dates or mathematical concepts like raising a number to a power.

< sub >

The < sub > element is used to contain characters that should be subscript. It is commonly used with foot notes or chemical formulas such.

sub and sup

White Space

In order to make code easier to read, web page authors often add extra spaces or start some elements on new lines.

When the browser comes across two or more spaces next to each other, it only displays one space. Similarly if it comes across a line break, it treats that as a single space too. This is known as white space collapsing.

Line Breaks & Horizontal Rules

< br />

As you have already seen, the browser will automatically show each new paragraph or heading on a new line. But if you wanted to add a line break inside the middle of a paragraph you can use the line break tag < br />.

< hr />

To create a break between themes — such as a change of topic in a book or a new scene in a play — you can add a horizontal rule between sections using the < hr /> tag.