November 2011
Intermediate to advanced
384 pages
13h 23m
English
You can highlight text in a web page, just like a highlighter pen on paper, using the new mark element in HTML5. This enables you to put additional new emphasis on a block of text, without using the older methods such as italicizing, bolding, or underlining:
<mark>text</mark>
Essentially, the mark element simply adds a yellow background color to enclosed text. The following CSS is built into all HTML5 web browsers:
mark {
background-color: yellow;
}
Most non-HTML5 web browsers will understand <mark>, but you will need to explicitly assign it a CSS declaration, just as in the preceding example. A good general guideline is to assign a value regardless; this way both newer and older HTML web browsers work fine.
In order for ...
Read now
Unlock full access