• Post category:HTML

Difference Between Strong vs Bold Tag in HTML

HTML Strong vs Bold Tag

Introduction

There are two tags in HTML to make the font bold which are <b> and <strong> tag, We can use any of the two tags to make the font bold. We can also make the font bold using the CSS “font-weight” property. But if you don’t know why HTML has two tags to make the font bold, then you have come to the right place. So in this article, I am going to tell you about HTML strong vs bold tags

What is a bold tag and how to use

A bold tag is a <b> tag, it is used to make text bold. It is paired tag, so we can use both opening and closing bold tags. The b tag is an inline element, which means <b> tags are displayed on the same line and not on the next line. It can also be used inside tags like <p>, <span>, <div>. A bold tag is used for some specific words and the sentence will be bold hairs.

Syntax

<b>..Your text..</b>

In the above syntax, First, we have written the opening <b> tag then inside the tag you can write some text and finally, we put the closing </b> tag. This is the syntax for using bold tags.

Example

<p>The birds are flying <b>Happily!</b> </p>
<span>The nature is very <b>Beauty</b></span>
<h1>This is <b>Heading tag</b></h1>

Output:

html strong vs bold

In the above code, we have a <p>, <span> and <h1> tags. Inside each tag is an individual <b> tag. But see the given output, the h1 tag doesn’t display bold text because the h1 tag is the default header tag, it has a default bolder tag. So, If we use bold tags inside heading tags we don’t know them.

READ ALSO  What are the Types of Tags in HTML | Explained

What is a strong tag and how to use it?

A strong tag is also used to make the text bold. We can use it also to make the text bolder. This tag is used for some sentences like the focus will be here more and this situation will use the strong tag.

Syntax

<stong>..Your sentence..</stong>

In the above syntax, First, we have written the opening <strong> tag then inside the tag you can write some sentences and finally we put the closing </strong> tag.

Example for strong tag

<p><strong>A computer is an electronic device, operating under the control of instructions. </strong>
It is Stored in its own memory that can accept data(input), processes the data according to specific rules,
produces information (output, and store the information for future use.</p>

Output:

html strong vs bold

In the above code, there is a paragraph inside the <p> tag and we use the <strong> tag in the first sentence. See the given output, the first sentence is displayed in bold.

 

Leave a Reply