HTML – Formatting

HTML – Attributes
November 3, 2018
HTML – Meta Tags
November 3, 2018

If you use a word processor, you must be familiar with the ability to make text bold, italicized, or underlined; these are just three of the ten options available to indicate how text can appear in HTML and XHTML.

Bold Text

Anything that appears within <b>…</b> element, is displayed in bold as shown below −

Example:-

<!DOCTYPE html>
<html>
<body>
<p><b>This text is bold</b></p>
</body>
</html>

Italic Text

Anything that appears within <i>…</i> element is displayed in italicized as shown below −
Example:-
<!DOCTYPE html>
<html>
<body>
<p><i>This text is italic</i></p>
</body>
</html>
This text is italic
The following word uses an This text is italic typeface.

HTML Formatting Elements

In the previous chapter, you learned about the HTML style attribute.
HTML also defines special elements for defining text with a special meaning.
HTML uses elements like <b> and <i> for formatting output, like bold or italic text.
Formatting elements were designed to display special types of text:

  • <b> – Bold text
  • <strong> – Important text
  • <i> – Italic text
  • <em> – Emphasized text
  • <mark> – Marked text
  • <small> – Small text
  • <del> – Deleted text
  • <ins> – Inserted text
  • <sub> – Subscript text
  • <sup> – Superscript text

HTML <b> and <strong> Elements

The HTML <b> element defines bold text, without any extra importance.

<!DOCTYPE html>
<html>
<body>
<p>This text is normal.</p>
<p><b>This text is bold.</b></p>
</body>
</html>
The HTML <em> element defines emphasized text, with added semantic importance.
<!DOCTYPE html>
<html>
<body>
<p>This text is normal.</p>
<p><em>This text is emphasized.</em></p>
</body>
</html>
Sondiva Technologies
Sondiva Technologies
Sondiva Technologies started in 2011 with a vision of providing Quality based Web Hosting and Web Designing Services in Ghaziabad, Delhi NCR. Backed up by full stack developers and designers , with over 500+ Web Projects. They work on opensource Platforms like Wordpress, Magneto, Prestashop, Opencart and Core PHP. Other services are : Responsive Web Designing Domain Registration Services Dedicated & SSD Hosting Virtual Private Servers Google GSuite Mail Servers E-Commerce Shopping Portal Development Web Designing & Application Courses SEO & Digital Marketing

Leave a Reply

Your email address will not be published. Required fields are marked *

Shop Now