Difference between CSS & Themes

Posted on 2009-05-06 22:49  wyatt_chen  阅读(155)  评论(0)    收藏  举报

With the great convenience of CSS Styles, developers get used to that instead of ignoring the advantage of themes. The disadvantage we really mind is CSS seems limited to a fixed set of style attributes and can not take control some aspects of server controls of ASP.

Then themes come to fill the defficit. Similiar to the CSS, themes allow you to define style attributes that you can apply to controls in multiple pages. On the contrary, themes are not fulfilled by the browser. In other words, it is independent on the server.

Here is key difference:

 

  • Themes are control-based, not HTML-based: As a result, themes allow you to define and reuse almost any control property. For example, themes allow you to specify a set of common node pictures and use them in numerous TreeView controls or to define a set of templates for multiple GridView controls. CSS is limited to style attributes that apply directly to HTML.

  • Themes are applied on the server: When a theme is applied to a page, the final styled page is sent to the user. When a stylesheet is used, the browser receives both the page and the style information and then combines them on the client side.

  • Themes can be applied through configuration files: This lets you apply a theme to an entire folder or your whole website without modifying a single web page.

  • Themes don’t cascade in the same way as CSS: Essentially, if you specify a property in a theme and in the individual control, the value in the theme overwrites the property in the control. However, you have the choice of changing this behavior and giving precedence to the properties in the page, which makes themes behave more like stylesheets.

                                         -- details please refer to Mattew MacDonald and Mario Szpuszta <<Pro Asp.net 3.5>>

博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3