Prev | Current Page 205 | Next

Rob Cameron and Dale Michalk

"Pro ASP.NET 3.5 Server Controls and AJAX Components"

first
{ font-family: Arial; color: Blue; font-weight:bold; font-style:italic; }
div.first
{ font-family: Arial; color: Red; font-weight:bold; font-style:italic; }
This produces different text layout depending on whether the class attribute first is used
with a or
tag:
Bold, Italic Blue Text
Bold, Italic Red Text
There are additional selectors that do more specialized selection of HTML elements, such
as the ability to group several selectors via commas. Please refer to a good text on CSS styling,
such as CSS Mastery: Advanced Web Standards Solutions (Andy Budd, Simon Collison, Cameron
Moll. friends of ED, 2006.), for more information on CSS selectors.
CSS provides several ways to formulate the style rules. You can place styles in their own
separate CSS file and bring them in via a tag as described previously, or you can place
CSS styles in a
You can also place CSS styles inline with the style attribute:
Yellow background, red text
This begs the question, what happens when style properties that are defined in several
different locations come together on the same document? CSS is built to handle this situation
and this is where the ???cascading??? part of the CSS acronym comes in to play.


Pages:
193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217