HTML <b> Bold Tag
Tags: learnhtml
Published: 2021-02-13 06:59:32

---
title: HTML <b> Bold Tag
published: true
date: 2021-02-12 06:00:27 UTC
tags: LearnHTML
canonical_url: https://sharepointanchor.com/learn-html/html-bold-tag/
---

The [HTML](https://sharepointanchor.com/category/learn-html/ "HTML") **<b>** tag is used to **highlight the bold appearance**  without conveying any importance. Simply said that it will **display the written text in bold format**.

Note: According to the [HTML](https://sharepointanchor.com/category/learn-html/ "HTML") 5 specifications,  it’s recommended to use the  **<b>**  tag only as a **last resource** , when it is **not possible to use other tags**.

## Syntax:

The bold tag always comes in pairs. The content is written between an **opening <b>**  **tag** and **closing </b> tag**.

```

<b>Text</b>

```

## Sample of the HTML <b> Tag:

```

<!DOCTYPE html>
<html>
  <head>
    <title>Bold Tag </title>
  </head>
  <body>
    <h2>Sample of Bold Tag</h2>
    <p>This is normal text, and <b>This is the bold text</b></p>
  </body>
</html>

```

## Result:

![](https://sharepointanchor.com/wp-content/uploads/2021/02/Result-8.png)<figcaption>Result</figcaption>

In this sample, we have created a <b> tag that enclosed the **“This is the bold text”** , that will display as bold text.

You can also use the following **[CSS](https://sharepointanchor.com/learn-css/)** property to set bold text that is “ **font-weight: bold;** ” Let’s see how:

### Example for font-weight property for making the text bold:

```

<!DOCTYPE html>
<html>
  <head>
    <title>Bold the Text</title>
  </head>
  <body>
    <h2>This is heading</h2>
    <p>This is normal text, and <span style="font-weight:bold;">this is bold text</span>.</p>
  </body>
</html>

```

### Result:

![](https://sharepointanchor.com/wp-content/uploads/2021/02/Result-2-1.png)<figcaption>Result</figcaption>

<script async src="//jsfiddle.net/Share_Point_Anchor/4q6ramet/2/embed/html,result/"></script>

## <b> Tag Vs <Strong> Tag:

In [HTML](https://sharepointanchor.com/category/learn-html/ "HTML"), both the **<b>** and **<strong>** tags are helps to highlight the text as a bold appearance. The <b> tag should help to markup text as bold without conveying any extra importance. To **convey extra importance** , you can use the **<strong>** tag.

## <b> Tag Styling Methods:

The <b> tag supports the **global attributes** and the **event attributes**. You can use the following properties to style an [HTML](https://sharepointanchor.com/category/learn-html/ "HTML") bold tag.

### Properties to style the visual weight/emphasis/size of the text in <b> tag:

- **[CSS](https://sharepointanchor.com/category/learn-css/ "CSS") font-style** – This CSS property helps to set the font style of the text such as normal, italic, oblique, initial, inherit.
- **CSS font-family** – This CSS property specifies a prioritized list of one or more font family names or generic family names for the selected element.
- **CSS font-size** – This CSS property will help to set the size of the font.
- **CSS font-weight** – This CSS property used to define whether the font should be bold or thick.
- **CSS text-transform** – This CSS property will control the text case and capitalization.
- **CSS test-decoration** – This CSS property specifies the decoration added to text such as **text-decoration-line** , **text-decoration-color** , **text-decoration- style**.

### Styles to coloring the text in <b> Tag:

- **CSS color** – This CSS property will specify the color of the text content and decorations.
- **CSS background-color** – This CSS property helps to set the background color of an element.

### Text layout styles for <b> Tag:

- **CSS text-indent** – This CSS property is used to specify the indentation of the first line in a text block.
- **CSS text-overflow ** – This CSS property helps to describe how overflowed content that is not displayed should be signaled to the user.
- **CSS white-space** – This CSS property describes how white-space inside an element is handled.
- **CSS word-break**  – This CSS property decides where the lines should be broken.

### Other Properties for <b> Tag:

- **CSS text-shadow**  – This CSS property helps to add the shadow to text.
- **CSS text-align-last**  – This CSS property will set the alignment of the last line of the text.
- **CSS line-height** – This CSS property defines the height of a line.
- **CSS letter-spacing** – This CSS property helps to decide the spaces between letters/characters in a text.
- **CSS word-spacing** – This CSS property specifies the spacing between every word.

## Browser Support:

![](https://sharepointanchor.com/wp-content/uploads/2021/02/Browser-Support-3.png)<figcaption>Browser Support</figcaption>

### Read Also:

- [**HTML <aside> Aside Tag**](https://sharepointanchor.com/learn-html/html-aside-tag/)
- [**HTML <acronym> Acronym Tag**](https://sharepointanchor.com/learn-html/html-aside-tag/)
- [**HTML <abbr> Abbreviation Tag**](https://sharepointanchor.com/learn-html/html-aside-tag/)
- [**HTML <address> Address Tag**](https://sharepointanchor.com/learn-html/html-aside-tag/)
- [**HTML <article> Article Tag**](https://sharepointanchor.com/learn-html/html-aside-tag/)

The post [HTML <code><b></code> Bold Tag](https://sharepointanchor.com/learn-html/html-bold-tag/) appeared first on [Share Point Anchor](https://sharepointanchor.com).