HTML FORMATTING

Fazzey's world



HTML Formatting

  • HTML Formatting is a process that allows us to format text to increase its visual appeal.
  • Various HTML tags can change how text appears on a web page and make the text attractive.  
  • We can use HTML text formatting tags to bold, italic, underlined text, and do more.

HTML Formatting Elements

<i> - Italic text.
<em> - Emphasized text.
<b> - Bold text.  
<strong> - Important text.
<sub> - Subscript text.    
<sup> - Superscript text.
<mark> - Marked text.

HTML <b> and <strong> Elements:

Bold: In HTML <b> element defines bold text. The <b> tag is a physical markup element, but do not add semantic importance.

Strong: HTML use the <b>...</b> tags or <strong>...</strong> tags. Both the tag have the same functioning but <strong> tag adds semantic strong importance to the text.

Example:

 
  <!DOCTYPE html>
  <html>
  <title>HTML</title>
  <body>
  <p>Bold text</p>
  <b>I'm fareen</b>
  <p><strong>I love being self depended!</strong></p
  </body
  </html
 


Output:



HTML <i> And <em> Elements:

Italic: One of the HTML <i> elements it is used to format HTML content. It can be used to define a text in technical terms of language and thoughts.

Emphasize: It is also one of the element of HTML <em> tag is  used to formatting texts. It is used to define emphasized text or statement. 

Example:

 
  <!DOCTYPE html>
  <html>
  <title>HTML</title>
  <body>
  <p>This text is normal.</p>
  <p>This text is <i>italic.</i></p>
  <p>This text is <em>emphasized.</em></p>
  </body
  </html
 

Output:



HTML <sub> And <sup> Elements:

Subscript: The <sub> element defines subscript text. Subscript text appears in half a character below the normal text lines. 

Superscript: The <sup> tag is used to add a superscript text to the HTML document. The <sup> tag defines the superscript text. Superscript text appears half a character above the normal line. 

 Example: 


  <!DOCTYPE html>
  <html>
  <title>HTML</title>
  <body>
  <p>This is<sub>subscript</sub>text</p>
  <p>This is<sup>superscript</sup>text</p>
  </body>
  </html>


Output:



HTML Mark Tag:

The <mark> tag is used to define the marked text in a HTML document. It is used to marked or highlight the part of the text in a paragraph.

Example:


  <!DOCTYPE html>
  <html>
  <title>HTML</title>
  <body>
  <h1 style ="color: blue;">GOCOURSE</h1>
  <h2>HTML mark Tag</h2>
  <p><mark>Gocourse:</mark> This is a <mark> HTML mark text </mark> used in this paragraph.</p>
  </body>
  </html>


Output: 





More topic in HTML

Our website uses cookies to enhance your experience. Learn More
Accept !

GocourseAI

close
send