HTML provides different tags for the styling. Bold <b> tag is used to make given text bold which is ticker than a normal one. Bold tag is used for the start and end of the text to specify the text we want to make bold.
<b> Bold Tag
As stated previously bold tag is used by specifying the start and the end of the text block we want to make bold. Bold tag is only effective in the normal text which means using the bold tag in Header tags like H1, h2 do not have any difference.
<html> <body> <h1><b>This header is bold</b></h1> <h1>This header is not bold</h1> <b>This text is bold</b> <br> This text is not bold </body> </html>
Make Bold with CSS
Bold is generally used as a tag inside the HTML body by surrounding the text. But We can make the bold specified text by using CSS. The CSS attribute is named
font-weight like below. In this example, we will define a CSS class named
bold and apply by using
span tag like below.
<html> <body> <span style="font-weight:bold;">This text is bold</span><br> This text is not bold <div style="font-weight:bold;"> This div content is bold</div> This div content is not bold </body> </html>
HTML Do Not Have <bold> Tag
Some novice web programmers and designers assume that there is a tag named <bold>. This is not true. The bold tag is represented as <b> not with <bold> If we try to use <bold> as a tag it will not work like below.
<html> <body> <b>This text is bold</b> <br> <bold>This text is not bold</bold> <br> This text is not bold </body> </html>
Text Formatting Elements
Bold tag is named as text formatting element and there are other text formatting elements which can be used for different purposes. Some of the text formatting elements or tags may provide a similar experience to the bold but they are not the same.
- <b> is used for bold text.
- <strong> is used for important text.
- <i> is used for italic text where the text will be leaned
- <em> is used for emphasized text
- <mark> is used for marking text
- <small> is used for making text smaller
- <del> deleted text
- <ins> is used for inserted text
- <sub> is used for subscribed text
- <sup> is used superscript like formulas