HTML and CSS Reference
In-Depth Information
Obviously, if there is a concern about using CSS3 color values, a hex value should be
used instead. A simple trick can be employed, however, in the situation where simply the
opacity is not supported but the standard color value is; just use the cascade aspect of CSS
to start with a known supported value and then follow it with the newer color format for
supporting browsers:
#greentest {color:rgb(0,255,0);
color:rgba(0,255,0,0.4);}
As the current specification is written, little is introduced by this CSS3 module. Most
modern browsers, save Internet Explorer 8, support these features.
N OTE The specification also clearly codifies in one place many of the various color values from
various specifications. See Appendix C for an overview of color values.
Namespaces
In XHTML and XML, it is possible to intermix markup languages in a single document.
When using mixed vocabularies, it is possible to have tags that have similar names but are
from different vocabularies. Commonly, an example is given of having the traditional
HTML tag <table> being confused with some <table> tag in a fictitious Furniture
Markup Language. Adding the concept of a namespace to indicate what vocabulary a tag
comes from eliminates confusion, but this would have to be extended to CSS. For example,
using our <table> tag example, what would the following rule do?
table {border: 1px solid red;}
Would it apply the rule to both types of tags or just one. What about if we wanted to
introduce a different look for each? Enter the CSS3 @namespace directive. As an example,
here we introduce a CSS rule for a standard <p> tag and one for a <p> tag in our custom
namespace:
<style type="text/css">
p {color: red;}
</style>
<style type="text/css">
@namespace "htmlref";
p {background-color: green; color: white;}
</style>
Then, depending on syntax, we might have
<p> This is a standard p tag and <p xmlns="htmlref"> a named spaced
p tag </p> and back to normal. </p>
When we can invoke an XML parser, the browser should apply different styles to the
differently namespaced tags:
Search WWH ::




Custom Search