BestWebTutorials.com
A service of CrystalClearWeb.net
 
Web BestWebTutorials.com

XHTML - <b (attr)="..."> Bold Text Tag with Attributes

Definition

See <b> </b> Bold Text for basic information about this tag.

Attributes

id (optional)

id is a unique identifier attached to the bold text element. Each id attribute in an XHTML document, no matter what element it is a part of, must be unique to function properly. The id attribute is used by CSS and javascript to modify the content or presentation of the bold text element.

The bold text element in the following example has the id "bold1".

<p>In this paragraph <b id="bold1">this text</b> is in a bold font.</p>

class (optional)

class is an identifier attached to the bold text element. class is usually not a unique attribute, but is actually attached to several different elements. The class attribute is used by CSS and javascript to modify the content or presentation of the bold text element.

The bold text element in the following example has the class "bold2".

<p>In this paragraph <b class="bold2">this text</b> is in a bold font.</p>

The bold text in the following example has two classes "bold3" and "bold4".

<p>In this paragraph <b class="bold3 bold4 ">this text</b> is in a bold font.</p>

A bold text element may have both an id attribute and one or more class attributes. The bold text element in the following example has an id "bold5" and two classes "bold6" and "bold7".

<p>In this paragraph <b id="bold5" class="bold6 bold7" >this text</b> is in a bold font.</p>

title (optional)

The title attribute determines the text that will appear in the small pop-up box when the cursor is placed over the bold text elementr. This attribute is not often used with a text element of any kind because users are used to seeing it used with links of some sort, and therefore the user might think that the text element is a link when they see the small pop-up text.

Example

<p>In this paragraph <b title="You should be able to see this text when the cursor is over the bold text ">this text</b> is in a bold font.</p>

Output

In this paragraph this text is in a bold font.

style (optional)

The style attribute is used to apply inline CSS styling to an element. There are many possible property and value combinations that can be set with inline CSS styling. Please see the CSS section of this website for a list of the possible combinations.

dir (optional)

The dir attribute controls the direction of the text in a bold element - theoretically. Maybe. Well, it probably won't work. Even if text is specified to be run right to left, the browser may not display the text as expected. Text direction may be controlled for an entire document by the specified language or the browser defaults. It is not recommended that users attempt to use this attribute with this element.

Example

<p>In this paragraph <b dir="ltr" >this bold text</b> is displayed from left to right. This is the default direction for English language websites.</p>
<p>In this paragraph <b dir="rtl" >this bold text</b> is displayed from right to left.</p>

Output

In this paragraph this bold text is displayed from left to right. This is the default direction for English language websites.

In this paragraph this bold text is displayed from right to left.

lang (optional)

The “lang” attribute is used to specify the language used in the element. If you are curious, there is a great deal of information available from w3.org here.

xml:lang (optional)

This is an attribute specifically for XML documents to specify the language of the element containing the attribute. This is a fairly rare tag. For more information check out the w3.org recommendation here.

Return to XHTML Tags with Attributes List
Go to XHTML Tags List

BestWebTutorials.com is a free service of CrystalClearWeb.net. You can help us keep providing free tutorials and information by:

  • Link to us
  • Tell a friend
  • Correct any  you might find
  • Make for improvement
  • Make a donation


web services byCrystalClearWeb.net