Prev | Current Page 206 | Next

Rob Cameron and Dale Michalk

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

The process can be
summarized this way: if the styles do not conflict, the attributes are combined in an additive
process. Also, style settings in the parent container apply to the parent??™s child elements.
When conflicts do arise because of the flow of style properties, there is a pecking order to
determine which style takes precedence. The rule is simple: definitions closer to the tag take
precedence over the more remote definitions, in terms of location on the page. The following
order is taken into consideration, with the last bullet taking precedence over the first bullet:
??? Browser defaults
??? External style sheet
??? Internal style sheet (inside the tag)
??? Inline style (style attribute on HTML element)
CHAPTER 4 ?–  THE WEBCONTROL BASE C LASS AND CONTROL STYLES 127
The previous example displays with a yellow background that it inherits from the
class selector, and its inline style color displays the text in red.
Style Properties and Visual Studio
Trying to remember what the various CSS properties are and how to use them can be a daunting
task. You either need to have a thick reference close at hand or use the CSS editing features
bundled with Visual Studio. Figure 4-1 shows a CSS style sheet in the main window and the
Explorer view of its rules on the left side.


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