views:

77

answers:

3

I want to know to use CSS in ASP.NET.

If I have set of CSS files and I link my master page to them, how to utilize them to make my application look good. I'm not talking about CSS itself but about how to use its elements in the source of any ASP.NET page.

I'm looking for suggestions, resources, sites, or opinions.

+5  A: 

in controls there is a property CssClass

<asp:Button ID="Button1" CssClass="Red" runat="server" Text="Button" OnClientClick='ani();'/>
anishmarokey
thanks i know this i talk about how to benefit from the CSS file to the maximum..
http://www.drostdesigns.com/top-12-benefits-of-using-css-for-web-pages/
anishmarokey
thank u so much this is great..
please select one answer as correct
anishmarokey
+3  A: 

In addition to @anishmarokey's answer don't forget that all all ASP.NET markup will render as HTML on the browser, so you can do anything that you can do to HTML. This even includes adding attributes such as style to all elements (even though intellisense will not prompt it). This will render correctly as a HTML style attribute on the client.

In addition CssClass can only be used on ASP elements, all others will require style

m.edmondson
+2  A: 

Based on your question + comments I think it's all about CSS.

Check the css Zen Garden:

demonstration of what can be accomplished visually through CSS-based design. Select any style sheet from the list to load it into this page.

They have 210 alternate CSS designs all using the same unmodified html. Take a look at the alternate designs, it's a very nice example on keeping the design aspects to the CSS.

eglasius