untitled

(John Hannent) #1
In addition to CSS information, this site explores many other topics related to
Internet programming: scripting, XML (and its many flavors), DHTML, ASP.NET,
SOAP (Simple Object Access Protocol, a light, flexible communications proto-
col built on XML), DOM (the Document Object Model, a standardized model of
the structure of an XML object), and so on.

Also take a look at these sites for valuable, advanced CSS information:

http://www.nypl.org/styleguide
http://www.quirksmode.org/

Remembering Inheritance ..........................................................................


One problem that many CSS authors, including moi,face is confusion about
why some styles are inherited and others are not. For example, say that you
specify that the text in a paragraph should be green, but somehow the entire
text is not green after all. Consider this example:

<p style=”color: green;”>This paragraph includes
<strong>boldface</strong> and also a link <a
href=”http://www.ebay.com/”>eBay</A> to a Web
page.
</p>

You specified green in your style, yet the hyperlink text (eBay here) isn’t
green. It’s blue or whatever color the user’s browser specifies for hyperlinks.
A browser rule wins over your style. But because the browser has no rule for
<strong>, that element turns green (inherits the color from the parent para-
graph element). So if you find yourself perplexed about why some style isn’t
being inherited, chances are you’re dealing with this issue. If you really, really
want to turn the link text green, you must override the browser style by
adding a style to that link, like this:

<p style=”color: green;”>This paragraph includes
<strong>boldface</strong> and also a link <a
style=”color: green;”
href=”http://www.ebay.com/”>eBay</A> to a Web
page.
</p>

Chapter 19: Ten Topics That Don’t Fit Elsewhere in the Book (But Are Important) 331

Free download pdf