HTML Formatting
Bold Text
Bold Text
The HTML <b> element defines bold text, without any extra importance.
Example
<!DOCTYPE html> <html> <body> <p>This text is normal.</p> <p><b>This text is bold.</b></p> </body> </html>
HTML Document Output
This text is normal.
This text is bold.
Strong Text
The HTML <strong>element defines strong text, with added semantic "strong" importance.
Example
<!DOCTYPE html> <html> <body> <p>This text is normal.</p> <strong><b>This text is Strong.</strong></p> </body> </html>
HTML Document Output
This text is normal.
This text is bold.
Grouping Content
Grouping Content
The <div> and <span> elements allow you to group together several elements to create sections or subsections of a page.
For example, you might want to put all of the footnotes on a page within a <div> element to indicate that all of the elements within that <div> element relate to the footnotes. You might then attach a style to this <div> element so that they appear using a special set of style rules.
Example
<!DOCTYPE html> <html> <body> <div id = "content" align = "left" bgcolor = "white"> <h5>Content Articles</h5> <p>Actual content goes here.....</p> </div> </body> </html>
HTML Document Output
Content Articles
Actual content goes here.....
The <span> element, on the other hand, can be used to group inline elements only. So, if you have a part of a sentence or paragraph which you want to group together, you could use the <span> element as follows.
Example
<!DOCTYPE html> <html> <body> <p>This is the example of <span style = "color:green"> span tag </span> and the <span style = "color:red"> div tag </span> alongwith CSS </p> </body> </html>
HTML Document Output
This is the example of span tag and the div tag alongwith CSS
Inserted Text
Inserted Text
The <ins> tag defines a text that has been inserted into a document.
Example
<!DOCTYPE html> <html> <body> <p>My favorite color is <s>blue</s> <ins>red<ins> </p> </body> </html>
HTML Document Output
My favorite color is blue red!
Italic Text
Italic Text
The HTML <i> element defines italic text, without any extra importance.
Example
<!DOCTYPE html> <html> <body> <p>This text is normal.</p> <i><b>This text is italic.</i></p> </body> </html>
HTML Document Output
This text is normal.
This text is italic.
em Text
The HTML <em>element defines emphasized text, with added semantic importance.
Example
<!DOCTYPE html> <html> <body> <p>This text is normal.</p> <em><b>This text is emphasized.</em></p> </body> </html>
HTML Document Output
This text is normal.
This text is emphasizedLarger Text
Larger Text
The <big> tag is not supported in HTML5. Use CSS instead.
The <big> tag defines bigger text.
Example
<!DOCTYPE html> <html> <body> <p>This text is normal</p> <p><big>This text is bigger.<big></p> </body> </html>
HTML Document Output
This text is normal.
This text is bigger.
Monospaced Font
Monospaced Font
The content of a <tt>...</tt> element is written in monospaced font. Most of the fonts are known as variable-width fonts because different letters are of different widths (for example, the letter 'm' is wider than the letter 'i'). In a monospaced font, however, each letter has the same width.
Example
<!DOCTYPE html> <html> <body> <p>The following word uses a <tt>monospaced</tt> typeface.</p> </body> </html>
HTML Document Output
The following word uses a monospaced typeface.
Smaller Text
Smaller Text
The <small> tag defines smaller text (and other side comments).
Example
<!DOCTYPE html> <html> <body> <p>This text is normal</p> <p><small>This text is smaller.<small></p> </body> </html>
HTML Document Output
This text is normal.
This text is Smaller.
Strike Text
Strike Text
The <strike> tag is not supported in HTML5. Use <del> or <s> instead.
The <strike> tag defines strikethrough text.
Example
<!DOCTYPE html> <html> <body> <p>This is <s>Strike text</s></p> </body> </html>
HTML Document Output
This is Strike text
Superscript
Superscript Font
The <sup> tag defines superscript text. Superscript text appears half a character above the normal line, and is sometimes rendered in a smaller font. Superscript text can be used for footnotes, like WWW[1].
Example
<!DOCTYPE html> <html> <body> <p>This text contains <sub>subscript<sub> text.</p> <p>This text contains <sup>superscript<sup> text.</p> </body> </html>
HTML Document Output
This text contains subscript text.
This text contains superscript text.
Underlined Text
Underlined Text
The <u> tag represents some text that should be stylistically different from normal text, such as misspelled words or proper nouns in Chinese.
Example
<!DOCTYPE html> <html> <body> <p>This is a <u>parragraph</u></p> </body> </html>
HTML Document Output
This is a parragraph
0 Comments: