Applying Bold and Italics
You learned how to apply bold and italic formatting by using the <b> and <i> tags in Part I 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 argument.
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= argument in an
individual paragraph.
<p style="font-weight: bold">This text is bold.</b>
One of the advantages of using a style for ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access