HTML Text Formatting

Formatting elements were designed to display

Updated:03/10/2024 by Computer Hope

We covered basic list formatting in HTML text fundamentals, but we overlooked the third kind of lists you may occasionally encounter: description lists. These lists are meant to be used for marking up lists of items and the descriptions that go with them, like terminology and definitions or questions and answers. Let's see an illustration of a vocabulary list with definitions

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> - Smaller text
  • <del> - Deleted text
  • <ins> - Inserted text
  • <sub> - Subscript text
  • <sup> - Superscript text

Below is an example of a basic web page written in HTML with a description of each section and its function.


            <!-- 
Example contain a formating of  text    of html.
It is  just create a simple web page in web browser
Note : open note paid and Save this code on notepad with extension of .html 
then right click and select option of Open with in Window user ,run with any browser and display output .
-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "https://www.w3.org/TR/html4/loose.dtd">
<html>
   <head>
   <title>Example page</title>
   <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
   </head>
   <body>
   <h1>This is a heading</h1>
<!--   here you can able see attribute of Heading Tag      -->

   <i>This text is italic  </i>  
   <i>This text is italic  </i>
   <em>This text is emphasized  </em>
   <small>This is some smaller text.  </small>
   <p>Do not forget to buy   <mark>milk  </mark> today.  </p>
   <p>My favorite color is   <del>blue  </del> red.  </p>
   <p>My favorite color is   <del>blue  </del>   <ins>red  </ins>.  </p>
   <p>This is   <sub>subscripted  </sub> text.  </p>
   <img src="images/smiley.webp" width="30" height="30" alt="Smiley"> 
   <a href="https://www.google.com/" title="Search Engine"> Google</a> 
   <a title="Hyper Text Markup Language"> HTML </a> 
   <input type="text" value="John Doe">     
   <p>This is an <b>example</b> of a basic HTML page.</p>
   </body>
</html>
          

Features of HTML Text Formatting

  • HTML text formattingtools are similar to those you would find in any text editor (e.g., MS Word). You can define bold text, write in italics, or otherwise change the look of your text.
  • HTML text formattingcannot define empty elements. This means you cannot omit the closing tag.

Top Most Html Article