All TalkersCode Topics

Follow TalkersCode On Social Media

devloprr.com - A Social Media Network for developers Join Now ➔

How To Make Text Bold In HTML

Last Updated : Jul 1, 2023

How To Make Text Bold In HTML

In this tutorial we will show you the solution of how to make text bold in HTML, in html most of programmers and developers come across with a problem that how to make text bold in html. Now, there are many ways to make the text bold in html.

The font that is bold in page become highlighted and looks attractive. Some designers used the bold text to make headings.

Hence, we want to say there are many methods to why we want bold text in html. So, in next we will define the ways that how we make bold text in html.

Step By Step Guide On How To Make Text Bold In HTML :-

Now, there are many ways to make text bold in html. Some of them are:

  • With the use of strong tag
  • With the use of bold tag
  • With the use of font-weight

Hence, there are some easy ways with the help of which you are able to make text bold in html. We will show you how all these works in the next example.

<!DOCTYPE html>
      <html>
        <head>
          <title> Title of the document<title>
	  </head>
	  <body>
<p>
        <b>
            this text is bold with the help of bold tag that is b.
        </b>
        <br>
        <br>
        <strong>
            this text is also bold but we use here strong tag.
        </strong>
    </p>
    <p style="font-weight: 900;">
        to make this text bold we use style attribute and font weight property
    </p>
	</body>
      </html>
  1. First, we write <! DOCTYPE html> which we used as an instruction to the web browser about what version of HTML file is written in.
  2. Secondly, the <html> tag is used to indicate the beginning of an HTML document.
  3. As above now <head> tag is used to contain information about web page. In this tag a <title> tag is used which helps us to specify a webpage title. Both <head> and <title> tags are Paired tags. So, both have </head> and </title> ending tags respectively.
  4. Thirdly, <body> tag is used to define the webpage body. All the contents to show on website are written here. In the body tag, here we create two paragraph tags, you can use one or more as you want and also you can nest them according to your choice.
  5. The first tag used is b that means bold. It is paired tag and the text in between tags become bold.
  6. In the next, we use strong which is similar to bold. It is also a paired tag and the text in between become bold also.
  7. At last here we use a CSS property, you can use this in any tag and in this we can to create style attribute. In this we use a property of font weight and in this we can describe value according to the weight. Mostly it lies in between 100 to 900 and the range between 500-900 is for bolder text.
  8. At last, the <body> and <html> tags are closed with </body> and </html> respectively.

Conclusion :-

In conclusion, we can say that we are able to make text bold in any tag and in any situation in html.

Mostly the property used is font weight property, this helps us to make text bolder. You can use b and strong tag also. I hope this tutorial on how to make text bold in html helps you

Author Image About Pragati

Experienced coding content writer who enjoys breaking down complex concepts in programming languages like Java, Python, C, and C++. Over three years of experience producing interesting and relevant content for a variety of entities. Committed to providing concise and easy-to-understand articles that assist readers in easily understanding technology and industry trends in the world of coding and software development.

Follow Pragati On Linkedin 🡪