Skip to content
Related Articles

Related Articles

Difference between strong and bold tag in HTML

View Discussion
Improve Article
Save Article
  • Difficulty Level : Easy
  • Last Updated : 06 Jun, 2022

HTML strong tag: The strong tag is one of the element of HTML used in formatting HTML texts. It is used to show importance of the text by making it bold or highlighting it semantically.

Syntax:

<strong> Contents... </strong>

HTML bold tag: The bold tag or <b> is also one of the formatting elements of HTML. The text written under <b> tag makes the text bold presentationally to draw attention.

Syntax:

<b> Contents... </b>

The main difference between these two tag is that the strong tag semantically emphasizes on the important word or section of words while the bold tag is just offset text conventionally styled in bold. Below is the code to show this difference.

Example 1: 

HTML




<!DOCTYPE html>
<html>
 
<head>
    <style>
        body {
            text-align:center;
        }
        h1 {
            color: green;
        }
    </style>
</head>
 
<body>
    <h1>GeeksforGeeks</h1>
     
     
<p><strong>
        This text is important!
    </strong></p>
 
     
     
<p><b>This text is bold.</p>
 
</body>
 
</html>                 

Output:

Though there is no difference in the display of both the tags but there is semantical difference between them.

Example 2: 

HTML




<!DOCTYPE html>
<html>
 
<head>
    <title>b tag</title>
     
    <style>
        body {
            text-align:center;
        }
        h1 {
            color: green;
        }
    </style>
</head>
 
<body>
    <h1>GeeksforGeeks</h1>
     
     
<p>
        Without <strong>internet</strong>
        we can not use gfg
    </p>
 
     
     
<p>
        <b>GeeksforGeeks:</b> A computer
        science portal for geeks
    </p>
 
</body>
 
</html>                   

Output:

We wanted to show the importance of the word “internet” so we used <strong> tag where as for the word “GeeksforGeeks”, we just simply wanted to format the text in bold.

Supported Browser: The browser supported by <b> and <strong> tag are listed below.

  • Chrome
  • Android
  • Firefox (Gecko)
  • Firefox Mobile (Gecko)
  • Internet Explorer (IE)
  • Edge Mobile
  • Opera
  • Opera Mobile
  • Safari (WebKit)
  • Safari Mobile

Let us see the differences in a tabular form -:

 strong tagbold tag
1.The <strong> tag is used to define text with strong importanceThe bold (<b>) tag specifies bold text without any extra importance.
2.The text inside this tag is boldIts makes any text bold.
3.It supports the Global attributes.It supports the Event attributes.
4.It supports the Event attributes.It supports the Global attributes.
5.

Its supported browsers are -:

Chrome , Microsoft Edge , Safari , Firefox , Opera Mini

Its supported browsers are -:

Chrome , Microsoft Edge , Safari , Firefox , Opera Mini


My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!