Additional HTML Markup for Text
Throughout this book, you have learned about several HTML elements that can be used for layout and content markup. In this appendix, I cover some additional HTML elements that can be used to mark up your text content.
<strong> element is used to signify that a piece of text is important and should be noted. Browsers will usually display the content as bold text; however, it is important to understand that by putting text within a
<strong> element you are also altering its semantic meaning. You should not use it purely for styling purposes. (In those cases, you should use the
<span> element and CSS, as discussed later in this appendix.)
<strong>Do not cross the bridge</strong>, as the support
structure has been weakened.
In the preceding example, I use the
<strong> element to indicate that the instruction is more important than the explanation.
<em> element is used to place emphasis on a particular word or phrase. This element can be used to change the meaning of a sentence and indicates that the content should be read with a different mood or voice. The following example conveys the tone that someone is very passionate about HTML5.
This would appear in most browsers as “HTML5 rocks!”
Browsers will usually style text within the
<em> element in italics, but again, it should not be used purely for styling purposes. Using a
<span> element with CSS would ...