Graphics Programs Reference
In-Depth Information
Figure 2-12: Combining styles due to differing specifi cities.
58
SUBSTRING ATTRIBUTE SELECTION
At er CSS2 was i nished, work immediately started on the next version of CSS, which we may
as well call CSS3 even though there's no single specii cation any more. (It's a long story.) One
of the areas that got the most attention was selectors, and attribute selectors were no excep-
tion. h ey picked up a set of substring-match patterns, all of which are incredibly useful.
h e most basic one is the substring matcher. To see how it's useful, consider an old example.
a[href="http: // w3.org /"]
h at's great for selecting any link to that exact URL. Suppose, though, that you have a lot of
links into the W3C's Web site, not just the home page, and yet you want to style them all the
same way. A good way to do that would be to select on just the w3.org part of the URL (see
Figure 2-13). Here's how:
a[href*="w3.org"] { font-weight : bold ;}
 
Search WWH ::




Custom Search