HTML and CSS Reference
In-Depth Information
<p lang="fr">Bonjour!</p>
<h4 lang="cy-en">Jrooana!</h4>
In general, the form [att|="val"] can be used for any attribute and its values. Let's say
you have a series of figures in an HTML document, each of which has a filename like
figure-1.gif and figure-3.jpg . You can match all of these images using the following
img[src|="figure"] {border: 1px solid gray;}
The most common use for this type of attribute selector is to match language values,
as demonstrated later in this chapter.
Using Document Structure
As mentioned previously, CSS is powerful because it uses the structure of documents
to determine appropriate styles and how to apply them. That's only part of the story
since it implies that such determinations are the only way CSS uses document structure.
Structure plays a much larger role in the way styles are applied to a document. Let's
take a moment to discuss structure before moving on to more powerful forms of
Understanding the Parent-Child Relationship
To understand the relationship between selectors and documents, you need to once
again examine how documents are structured. Consider this very simple HTML
<base href="http://www.meerkat.web/">
<title>Meerkat Central</title>
<h1>Meerkat <em>Central</em></h1>
Welcome to Meerkat <em>Central</em>, the <strong>best meerkat web site
on <a href="inet.html">the <em>entire</em> Internet</a></strong>!</p>
<li>We offer:
<li><strong>Detailed information</strong> on how to adopt a meerkat</li>
<li>Tips for living with a meerkat</li>
<li><em>Fun</em> things to do with a meerkat, including:
<li>Playing fetch</li>
<li>Digging for food</li>
<li>Hide and seek</li>
Search WWH ::

Custom Search