HTML Formatting

HTML formatting includes many elements which give different styles to the text. These elements can format a simple text in different styles.

For example, we can make bold text by <b>, make the text italic by <i>. In addition to this, we will use different kinds of tags for different purposes.

Italic text

i tag is used to give an italic style to a piece of text. The text will no longer be straight.

Example

This paragraph is without any formatting.

This paragraph has been given italic style.

Try </>

Bold text

b tag is used to represent bold text with respect to its surrounding text. It is an inline element.

Example

This text is not bold.

The letter heading was highlighted.

Try </>

Its main purpose is to attract the attention of users to specific keywords in a large amount of text.

Underlined text

u element is used to underline text with respect to its surrounding text. It is an inline element.

Example

This paragraph is simple.

The underlined text represents the spelling mistakes.

Try </>

Its main purpose is to underline the spelling mistakes in a document.

Emphasized text

em tag is used to emphasize text. It gives emphatic stress to the text.

Example

This paragraph is simple without any formatting.

This paragraph is emphasized using em element.

Try </>

This element resembles the italic element in style. But the position of em element in a sentence changes the meaning of the sentence.

They are different with respect to their use but are same with respect to style.

strong element

strong element is used to aware someone about the warning (seriousness), note (importance) or tip.

Example

NOTE: The strong element should be used to represent seriousness, urgency in the text.

NOTE: The strong element should be used to represent seriousness, urgency in the text.

Try </>

Both b (bold) and strong elements are same with respect to style but different with respect to their use.

mark element

mark tag is used to mark a piece of text. By default the background color of the marked text is yellow.

Example

This paragraph has not been marked.

This paragraph is marked.

Try </>

The main use of mark element is to highlight important points which are more relevant to the user's current activity.

small element

small represents the small font-size of text.

Example

Overuse of that thing will cause disaster.

Overuse of that thing will cause disaster. Try </>

The small element is commonly used for side comments, copyright information or important text.

Note:big element is not included in HTML5. Now CSS properties should be used to change the font-size.

del element

del element defines the deleted text.

Example

The text was not deleted.

The text was deleted.

Try </>

insert element:

ins element is used to represent the addition of text.

Example

Here the text is already present.

Here the new text has been entered.

Try </>

sub element

sub element defines the subscript in an equation. This element is used to make a subscript. It default font-size is small.

Example

vf = vi+at

vf= vi+at

Try </>

sup element

sup element defines the superscript in an equation.

See the example below.

Example

52=25

a2=b2+c2

Try </>

span element

span element is used to style a piece of text. It is used to make annotations.

Example

Here annotations are made using CSS properties.

Try </>

Var element:

var element is used to write variables in an expression. For example, S=at2

Here “S” is distance. “a” is acceleration and “t” is time. And these are variables.

Example

Equation of distance is s = vt

Equation of distance is S = vt

Try </>


Was this article helpful?