The b element is used to set a text to bold. The b stands for boldface. The text is written in between the opening and closing tags of the b element.
The b element is used to set a text to bold. The b stands for boldface. The text is written in between the opening and closing tags of the b element.
Syntax
The <b> tag is written as <b></b> with the text to bolden inserted between the opening and closing tags. That’s is:
1 |
<b>text here</b> |
Join other Subscribers on our YouTube channel and enjoy daily pogramming tutorials.
Recommended
Difference Between Absolute and Relative References in HTML
A relative reference does not specify the complete path to a web page. It specifies only the name...
Example:
1 |
<b> This text is in bold</b> |
The b element has similar function to the strong element except that the strong element adds semantic meaning or significance to the text. The b element does not add any significance to the text except that it makes it bold. If you want to add any importance to the text, use the <strong> element.
Using the b element to bolden list of items
One typical situation you may use the b element is when you want to list some items and have them boldened in order to draw the reader’s attention to it yet, without need for any special importance added. Example:
Every programmer should learn to write good code in his chosen language such as <b> Java, C, C++ , Python </b> and many more.
Article lede: Using the b element to capture reader’s attention to main content of the article at the beginning.
In an article, the writer may want to arrest the attention of the reader at the very onset and let him know what his article is all about. To do that, he could use the <b> element to bolden the first few texts in the first paragraph.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
<!Doctype html> <html> <head><title>The b element</title></head> <body> <article> <h1>JavaScript dethrones Java</h1> <p><b>The days where the learning and mastery of Java and its predecessors like C and C++ seem to be fast waning.</b></p> <p>Many languages like Python and JavaScript have boldly stepped out of the shadows and now command sizable followers in the programming community. With these, JavaScript has eventually risen to the peak as the new king as the language currently does not shy away from any field. Talk of app development, backend development and many others. It's a behemoth that no modern programmer can overlook.</p> </article> </body> </html> |
Output
Example of code demonstrates <b> tag
1 2 3 4 5 6 7 8 9 10 11 12 13 |
<!DOCTYPE html> <html> <body> <h1>HTML b tag</h1> <!--paragraph Tag --> <p>This is a normal text</p> <!--bold Tag --> <b>This is bold text</b> </body> </html> |
Output
Attributes
An attribute of an html element adds modification to the element and affects how the element behaves or appears.
Global Attributes
The b element supports global attributes.
You May Also Like…
Block And Inline Level Tags in HTML
Block elements start on a new line and end with a carriage return. That's, immediately after ending on a horizontal...
Selecting a browser for HTML5 development
Google's Chrome browser is simple to use and has the most up-to-date HTML5 features making it easier for developers....
Top 10 HTML5 formatting tags
HTML offers a range of elements for formatting text. HTML formatting tags include : <b> - Bold text...
0 Comments