O'Reilly logo

Microsoft® HTML5 Step by Step by Faithe Wempen

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Applying Bold and Italics

You learned how to apply bold and italic formatting by using the <b> and <i> tags in Part 1 of this book. You can continue to use those tags to format individual words and phrases, but you can’t use them in internal or external style sheets.

To include boldface in a style, use the font-weight attribute. For example, you might create a class called boldface in your style sheet like this:

.boldface {font-weight: bold}

You can apply the boldface class to all text elements of a specified type, for example, all paragraphs, in style sheets.

p {font-weight: bold}

You can also apply it by using a style= attribute in an individual paragraph.

<p style="font-weight: bold">This text is bold.</p>

One of the advantages of using a style for ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required