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.
<b>I’m bold text</b> <b>I’m strong text</b>
I’m strong text
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
Italic:
In HTML to format some piece of text as italic we can use elements.
<i>I’m italic text</i>
Underline
In HTML to format some piece of text as underlined we can use elements.
<u>I’m underlined text</u>
Super/Sub Scripts
In HTML to format some piece of text as underlined we can use elements.
He's the 11<sup>th</sup> player of the team. a<sub>1n</sub>, a<sub>2n</sub>, a<sub>3n</sub>......,a<sub>n</sub>
a1n, a2n, a3n......,an
Strike Through:
In HTML to format some piece of text as strike through we can use elements.
<Strike>I’m strike through text</strike>
Linefeed
Goto Line Break Section in the …………………… Post
Paragraph
In HTML to divide a long topic, under discussion, into different paragraph we use <p> element.
<p>I’m a paragraph.</p> <p>I’m another paragraph.</p>
I’m a paragraph.
I’m another paragraph.
Note: The ending tag of the paragraph </p> is optional, you can get the accurate result without using it. But if you are using XHTML thne it would be necessary to include the ending tag of Paragraph Element.
The Paragraph Element automatically includes a Line Break Element, so you don't need to include line break to feed a new line after a paragraph.
No comments :
Post a Comment