How to make part of text bold in HTML?

by porter.bins , in category: HTML/CSS , 2 years ago

How to make part of text bold in HTML?

Facebook Twitter LinkedIn Telegram Whatsapp

2 answers

by Ekaterina_90 , 2 years ago

@porter.bins  To make part of the text bold in HTML use either the strong tag or the b tag:


1
2
3
4
5
6
7
8
9
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
  </head>
  <body>
    <p>This is normal text. <b>part of the text bold in HTML</b>.</p>
  </body>
</html>


Member

by alyce , 9 months ago

@porter.bins 

To make a part of text bold in HTML, you can use the <b> or <strong> tag. Here's an example:

1
This is bold text.


or

1
This is bold text.


Both <b> and <strong> tags are used to specify bold text. The <strong> tag is typically used to indicate the importance of the text, while the <b> tag is used for stylistic purposes. However, modern HTML standards suggest using <strong> for emphasis or importance, while <b> is used mainly for styling effects.


You can also use inline styles to make text bold using the <span> tag:

1
This is bold text.


In this case, the font-weight property with the value bold is applied directly to the <span> tag to make the text bold.