Connect with us

Hi, what are you looking for?


HTML: 3 Ways to CSS Text Bold

HTML: 3 Ways to CSS Text Bold

In this lesson you will learn how to put bold text in CSS using 3 methods.

In most cases you will use a bold keyword to bold the font using the font property. But if you want to apply different amounts of courage, you can use a multiple of 100.

In addition, you can use embedded CSS for elements and use <b> and <strong> to bold the paragraph text. Below you will find some examples:

1. Use of CSS font feature in header section

For the font weight, enter the number that defines the font in bold: is normal, bold, lighter or a multiple of 100 from 100 to 900, with 400 equivalents of normal. Larger and lighter than the upper element.

Syntax for font size

Font size: normal|fat|light number|initial|initialized ;

How to specify letter weights

font size: 700;
font size: bold; /* as 700 */
font size: normal; /* as 400 */
font size: lighter; /* compared to the parent element */

CSS for the leading class of section

< style>
.bold_text {
font: bold;


<body><p class=bold_text> Here the full paragraph is bold.</p></body>.

Net revenue

The whole paragraph is in bold.

2. Use of element <b>

Place element <b> between the paragraph element to make a certain part of the paragraph bold.


<p>The other part of sub-point <b> is in bold </b>.</p>.

Net revenue

Part of the article is printed in bold.

3. Use of the <fort>element

Bold the text of a specific part of a paragraph using <strong>


<p> Part of the paragraph will be bold <strong> with a strong </strong>.</p> element.

Net revenue

Part of the subject is printed in bold with a strong element.

Full example

<DOCTYPE html>
<html lung=en

<Head><Style>.bold_text {fat_text {font-weight: bold;}</tyle>>Head>

<Bodies >
. Testing: Put the text in bold in the CSS</h1>
<h2> Use CSS class</h2>
<p class=bold text> It is a whole paragraph in bold.</p>
<h2>Use b</h2>
<p>On a part <b>The bold paragraph</b>.</p>
<h2>Element bold.</h2>
<p>On a part of the bold paragraph </strong>.</p>


Net revenue

As the figure in this article shows.

See also:

  • HTML : 3 How can I add CSS styles to a web page?
  • CSS : Define the family and font size

HTML: 3 Ways to CSS Text Bold

Vinish Kapoor

Follow @foxinfotech.

Hi, I’m a full-fledged developer and I write about development. I document everything I learn and help thousands of people. is made, written and maintained by me; it is built on WordPress and placed in Bluehost. Connect with me via Facebook, Twitter, GitHub, and get notifications of new messages. Do you have any questions or remarks? Discuss it with me.



 css font italic,css plain text

You May Also Like