Reputation: 141
I want to use a css style that will apply to all the control of it's kind.
.(Kind of Control)
{
css propeties;
}
How can I do it ?
Thank you very much
Upvotes: 0
Views: 2856
Reputation: 8471
You may have to approach this differently, in that you need to set up a skin of the control type and apply a CSS to it.
There is more detail on the MSDN site
Also, on the link above you can review Themes which may also be helpful.
Themes are similar to cascading style sheets in that both themes and style sheets define a set of common attributes that can be applied to any page. However, themes differ from style sheets in the following ways:
Themes can define many properties of a control or page, not just style properties. For example, using themes, you can specify the graphics for a TreeView control, the template layout of a GridView control, and so on.
Themes can include graphics.
Themes do not cascade the way style sheets do. By default, any property values defined in a theme referenced by a page's Theme property override the property values declaratively set on a control, unless you explicitly apply the theme using the StyleSheetTheme property. For more information, see the Theme Settings Precedence section above.
Only one theme can be applied to each page. You cannot apply multiple themes to a page, unlike style sheets where multiple style sheets can be applied.
However:
"A theme can also include a cascading style sheet (.css file). When you put a .css file in the theme folder, the style sheet is applied automatically as part of the theme. You define a style sheet using the file name extension .css in the theme folder."
Upvotes: 2
Reputation: 22321
You can apply the styles even without specifying the CssClass="YourStyle" property just like below example.
<style type="text/css">
[type=textarea]
{
css propeties;
}
</style>
Upvotes: 0
Reputation: 18659
Try for textbox:
[type=text]
{
css propeties;
}
for text area
textarea
{
css propeties;
}
Upvotes: 1
Reputation: 4189
For example if you want to apply a css to all labels, just type;
label
{
css propeties;
}
note: use html control names to do this.
Upvotes: 0