How to make text bold in HTML?

JavascriptWeb DevelopmentFront End Scripts

To make text bold in HTML, use the <b>…</b> tag or <strong>…</strong> tag. Both the tags have the same functioning, but <strong> tag adds semantic strong importance to the text. The <b> tag is a physical markup element, but do not add semantic importance.

Just keep in mind that you can get the same result in HTML with CSS font-weight property.

Example

You can try to run the following code to make text bold in HTML using <strong>…</strong> tag

Live Demo

<!DOCTYPE html>
<html>
   <head>
      <title>HTML text bold</title>
   </head>

   <body>
      <h2>Our Products</h2>
      <p>Developed 10 <strong>Android</strong> apps till now.</p>
   </body>
</html>

Example

You can try to run the following code to make text bold in HTML using font-weight property

Live Demo

<!DOCTYPE html>
<html>
   <head>
      <title>HTML text bold</title>
   </head>

   <body>
      <h1>Tutorialspoint</h1>
      <p style="font-weight: bold;">Simply Easy Learning</p>
   </body>
</html>
raja
Published on 18-Jan-2018 14:51:52
Advertisements