Basic Text Formatting in HTML

While formatting our documents we often need to format some pieces of text as bold, italic, underline, superscript, subscript and/or strikethrough to show the importance of the text. HTML provides us different tags perform such type of formatting. Let’s have look at each one!


Bold or Strong

In HTML to format some piece of text as bold we can use and/or elements.

Difference between Bold & Strong:

There are some browsers which are used by the special peoples (disabled) who can see
nothing on the screen. Rending of webpages on such browsers is done by reading text loudly. The text wrapped in strong element is read stressfully which indicates that the stressed text is important, while the text wrapped in b element is read normally without producing any stress to inform the listener that there is nothing special here.

Example:

I’m bold text
I’m strong text

Bold and Strong Text Example


Italic

In HTML to format some piece of text as italic we can use elements.


Example:

I’m italic text



Underline         

In HTML to format some piece of text as underlined we can use elements.


Example:

I’m underlined text



Super/Sub Scripts

In HTML to format some piece of text as underlined we can use elements.


Example:

He’s the 11th player of the team.
a1, a2, a3……,an



Strike Through

In HTML to format some piece of text as strikethroughwe can use elements. Strikethrough is used to show some old text which is no longer part of the newer version of the text but you still want to display it as reference text or something else.


Example:

I’m strikethrough text


Linefeed

Goto Line Break Section in the White Spaces Post.


Paragraph

In HTML to divide a long topic, under discussion, into different paragraph we use

element i.e. wrap the text in-between

and

tags.


Example:

I’m a paragraph.

I’m another paragraph.




Note: The ending tag of the paragraph

is optional, you can get the accurate result without Paragraph element automatically includes line break element
.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s