HTML and CSS Reference
In-Depth Information
The <mark> element allows you to do the markup equivalent of
using a highlighter pen to bring out some words on a printed
page. It's not the same as emphasis—for that you use <em> . But
if you had some existing text and wanted to bring something to
the fore that isn't emphasised in the text, you could use <mark>
and style it to be italics, or with a yellow highlighter-pen back-
ground colour. In print, you'll often see the phrases “my italics”
or “emphasis added.”
The spec also says, “When used in the main prose of a docu-
ment, it indicates a part of the document that has been high-
lighted due to its likely relevance to the user's current activity.”
As an illustration, on my own site, I use an adapted version of
Stuart Langridge's searchhi script (
browser/searchhi/ ) , which checks to see if the referrer to a page
was a search engine and the search terms are in the query string.
If they are, the script walks the DOM and surrounds each instance
of a search term with a <mark> element, which is then styled a
pretty pink. It would have been wrong to wrap these search terms
in <strong> or <em> as they're not emphatic—and this would have
changed the meaning of the content of our page—but are rel-
evant to the user's current activity: arriving at a page on our site
looking for information about a certain search term.
<ruby>, <rt>, <rp>
The <ruby> element is a useful addition for those writing content
in some Asian languages. Daniel Davis has a very useful article,
“The HTML5 <ruby> element in words of one syllable or less”
in-words-of-one-syllable-or-less ) , in which he explains how it
works, along with the related <rt> and <rp> tags, in the context
of Japanese (used with kind permission):
Any piece of Japanese text (banner ad, article, legal doc, and so
on) uses a combination of kanji, hiragana, and katakana writing
systems. It is sometimes the case that people reading the text
can't read the kanji, especially because kanji characters can have
more than one pronunciation. People and place names are one
example of kanji having numerous or irregular pronunciations.
can be pronounced “nichi,” “hi,” or “ka”
can be pronounced “hon” or “moto”
can be pronounced “nihon” or “nippon”
Search WWH ::

Custom Search