Apply visual designs to your text using CSS


Use the strong tag to make text bold:

  • To make text bold, you can use a strong tag. 
  • This is often used to draw attention to the text and symbolize that it is important.
  •  With the strong tag, the browser applies the CSS of "font-weight: bold;" to the element.
  • The syntax of strong tag is:
            <strong> text portion to be made bold</strong>

Use u tag to underline text:

  • To underline the text we can use u tag on a section of a text that is to be underlined.
  • With the u-tag, the browser applies the CSS of  "text-decoration: underline;" to the element.
  • The syntax of the u-tag is:
            <u> text to be underlined</u>

Use the em-tag to italicize the text:

  • We can italicize a portion of a text or the whole text by wrapping the text in an em tag.
  • The syntax of the em-tag is:
            <em>text to be italicized</em>

Use the s-tag to strike through the text:

  • We can strike through a text using the s-tag, it usually represents that the text portion is no longer valid.
  • With the s-tag, the browser applies the CSS of  "text-decoration: line-through;" to the text.
  • The syntax of the s-tag is:
        <s>text to be stricken through</s>

Use the hr-tag to create a horizontal line:

  • We can separate the text blocks using a horizontal line created by using the hr-tag.
  • The syntax of the hr-tag is:
            <hr>
  • Note that hr-tag is a self-closing tag.

No comments:

Post a Comment