HTML-Text Formatting in HTML(HTML-9)

                                           

HTML text formatting is a crucial aspect of web development. It allows you to change the appearance of text on a web page, such as

  • <strong> & <b>
            These tags make text bold. Use <strong> for important content and <b> for stylistic purposes only.
  • <em> <i> 
            These tags make the text italic. Use <em> for important content and <i> for stylistic purposes only.
  • <u> 
            This tag underlines the text.
  • <s> <del>
            These tags strikethrough text. Use <del> when the text has been deleted and <s> for stylistic purposes.
  • <mark>
            This tag highlights text with a yellow background.
  • <sup> & <sub>
            These tags create superscript and subscript text, respectively.
  • <small>
            This tag makes text smaller.
  • <p> 
            This tag creates paragraphs.
  • <br> 
            This tag creates line breaks without starting a new paragraph.


In this post, we'll explore some of the most common HTML text formatting tags and how to use them.


Bold Text -<b>/<strong>

To make text bold in HTML, you can use the <strong> tag or the <b> tag. Both of these tags will make the text bold, but the <strong> tag is semantically more important and should be used for emphasis, while the <b> tag is used for stylistic purposes only.

Example:

Italic Text-<em>/<i>

To make text italic in HTML, you can use the <em> tag or the <i> tag. Both tags will make the text italic, but the <em> tag is semantically more important and should be used for emphasis, while the <i> tag is used for stylistic purposes only.

Example:


Underlined Text-<u>

To underline text in HTML, you can use the <u> tag. This tag will make the text underlined.

Example:

Strikethrough Text-<s>/<del>

To strikethrough text in HTML, you can use the <s> tag or the <del> tag. Both tags will make the text strikethrough, but the <del> tag is semantically more important and should be used when the text has been deleted, while the <s> tag is used for stylistic purposes only.

Example:



Superscript and Subscript Text-<sup>/<sub>

To display text as superscript or subscript in HTML, you can use the <sup> tag or the <sub> tag, respectively. These tags are often used for displaying mathematical formulas or chemical equations.

Example:


Small Text 

To display text in a smaller font size in HTML, you can use the <small> tag. This tag can be useful for displaying fine print, copyright notices, or other text that needs to be smaller than the surrounding text.

Example:



Text Alignment

To align text in HTML, you can use the text-align property in CSS. There are four possible values for text alignment: left, right, center, and justify. We'll talk more about CSS properties in upcoming posts.

Example:



conclusion

In conclusion, HTML text formatting is a powerful tool that can be used to improve the readability and appearance of text on a web page. By using the right tags and CSS properties, you can make your text stand out and be more effective in conveying your message. choosing the right tag can make a big difference in the readability and appearance of your web page. By using these tags effectively, you can create well-structured and visually appealing content.

Thank you catch you at the next one😍

Post a Comment

أحدث أقدم
LightBlog
LightBlog