HTML <b> tag (presentational)S2C Home   « HTML <b> tag

Definition

The <b> tag is used for making bold text.

Use the <strong> tag or for even greater control use the CSS font-weight property.

Example


<b>This text will be in bold type.</b>

Required Attributes

NONE

Optional Attributes

NONE

Common Attributes

class - specifies a classname for the element allowing you to apply the style of the predefined class to the content.


<b class="classname">Some text here</b>

id - specifies a unique id for the element allowing you to apply the style of the predefined id to the content.


<b id="idname">Some text here</b>

style - specifies an inline style for the element allowing you to apply the style to the content.


<b style="color:red;text-align:left">Some text here</b>

title - specifies extra information about the content.


<b title="information about the content">Some text here</b>

Language Attributes

dir - specifies the directional flow of the content.


<!-- The text will flow from left to right -->
<b dir="ltr">Some text here</b>

<!-- The text will flow from right to left -->
<b dir="rtl">Some text here</b>

lang - specifies a language code for the content of the element.


<b lang="en">Some text here</b>

xml:lang - specifies a language code for the content of the element in XHTML documents.


<b xml:lang="fr">Some text here</b>

Document Event Attributes

NONE

Form Event Attributes

NONE

Image Event Attributes

NONE

Keyboard Event Attributes

onkeydown - The JavaScript code to be run when an element is in focus and keyboard key is pressed.


<!-- Executes the go() function -->
<b onkeydown="go()">Some text here</b>

onkeypress - The JavaScript code to be run when an element is in focus and keyboard key is pressed down and released.


<!-- Executes the go() function -->
<b onkeypress="go()">Some text here</b>

onkeyup - The JavaScript code to be run when an element is in focus and keyboard key is released.


<!-- Executes the go() function -->
<b onkeyup="go()">Some text here</b>

Mouse Event Attributes

onclick - The JavaScript code to be run when a mouse is clicked on the element.


<!-- Executes the go() function -->
<b onclick="go()">Some text here</b>

ondblclick - The JavaScript code to be run when a mouse is double clicked on the element.


<!-- Executes the go() function -->
<b ondblclick="go()">Some text here</b>

onmousedown - The JavaScript code to be run when the mouse button is pressed down while the cursor is over the element.


<!-- Executes the go() function -->
<b onmousedown="go()">Some text here</b>

onmousemove - The JavaScript code to be run when the mouse button is moved.


<!-- Executes the go() function -->
<b onmousemove="go()">Some text here</b>

onmouseout - The JavaScript code to be run when the mouse cursor moves off an element.


<!-- Executes the go() function -->
<b onmouseout="go()">Some text here</b>

onmouseover - The JavaScript code to be run when the mouse cursor moves over an element.


<!-- Executes the go() function -->
<b onmouseover="go()">Some text here</b>

onmouseup - The JavaScript code to be run when the mouse button is released while the cursor is over the element.


<!-- Executes the go() function -->
<b onmouseup="go()">Some text here</b>

go to home page Homepage go to top of page Top