HTML Formatting basically refers to the enhancing of text in order to increase the visual appeal. HTML provides a range of formatting tags that can be used to make the text attractive to the users. There are many options available that can be used for formatting, just like any other text editor.

HTML Formatting tags

HTML Formatting Tags

There are two types of HTML tags:

  • Physical tags- These tags provide a visual appeal to the document. For example, bold, italic, underlined, etc.
  • Logical tags- These tags provide a logical meaning to the text. For example, the tag.

Formatting Text in HTML

Now, we shall discuss some of the major formatting text in HTML.

1. HTML Headings

HTML headings range from 1 to 6. The heading defined within 

 is the more important i.e. larger font-size and font-weight whereas 

 is the least important i.e. least font-size. These headings can be judiciously used to format the text.

 <html> 
<head> 
<title>DataFlair</title> 
</head> 
<body> 
<h1>DataFlair Heading 1</h1>
<h2>DataFlair Heading 2</h2>
<h3>DataFlair Heading 3</h3>
<h4>DataFlair Heading 4</h4>
<h5>DataFlair Heading 5</h5>
<h6>DataFlair Heading 6</h6>
</body> 
</html> 

Output:

html heading tag

2. HTML Bold text

This is defined by the  tag. This is a physical tag which is used to display the text in Bold. For example,

 <!DOCTYPE html>
<html>
<head>
<title>DataFlair</title>
</head> 
<body>
<p><b>Welcome to DataFlair!</b></p>
</body>    
</html>

Output:

html strong tag

3. HTML Strong Element

It displays the content in a manner such that it appears as important.

  <!DOCTYPE html>
<html>
<head>
<title>DataFlair</title>
</head> 
<body>
<p><strong>Welcome to DataFlair!</strong></p>
</body>    
</html>

Output:

html bold tag

#html tutorials #html formatting #html

Learn Text Formatting in HTML
3.30 GEEK