Graphics Programs Reference
In-Depth Information
Figure 2-12: Combining styles due to differing specifi cities.
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: // /"]
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 part of the URL (see
Figure 2-13). Here's how:
a[href*=""] { font-weight : bold ;}
Search WWH ::

Custom Search