How to write bold text using HTML ?
In this article, we will write Bold Text in HTML by using the <b> tag in the document. It is used to indicate the importance of the text. The text is written within <b> tag display in bold size. You can do the same things by using CSS also and there is a similar tag <strong> tag that has a similar effect on content.
Syntax:
<b> Contents... </b>
Example:
<!DOCTYPE html> < html > < head > < title > Write bold text using HTML tags </ title > < style > body { text-align: center; } h1 { color: green; } </ style > </ head > < body > < h1 >GeeksforGeeks</ h1 > < h2 > Write bold text using HTML tags. </ h2 > < p > < b >GeeksforGeeks:</ b > A < b >computer science</ b > portal for geeks </ p > </ body > </ html > |
Output:
By using CSS: The font-weight CSS property is used to make the text content bold.
Example:
b { font-weight: bold; } |
Supported Browsers:
- Google Chrome
- Internet Explorer
- Firefox
- Opera
- Safari