joe_pool_is Posted April 1, 2005 Posted April 1, 2005 In the ASP.NET environment using VS.NET, there is a WebControl Appearance Property called CssClass that I have always been curious about how to use. (Similarly, the Properties for things like the <BODY> tag include Style elements.) I searched all of this forum, but only found one instance of someone asking about CssClass. I went to MSDN's site, and I was able to find what CssClasses are for and how to create them, but not how to use them in my ASP.NET classes using VS.NET. Are there any good links out there that I could look into for tutorials or examples? Could someone tell me in a nutshell how to use this property and how to create the CssClass? I assume it is a separate file for the project, but I hate to ***-u-me. Any pointers from those "in the know" would be greatly appreciated. Quote Avoid Sears Home Improvement
kahlua001 Posted April 1, 2005 Posted April 1, 2005 When you specifiy a CssClass on a control, then the class attribute of a <span>(for labels) or the form element itself, will be set. So if youw anted a textbox to have a particular style, yu would set its CssClass. then either in your inline css you specify that class or you could put it in a external file in which you reference. <html> <head> <style> .big-letters { size:20px; } </style> </head> <body> <asp:Label id="Label1" runat="server" CssClass="big-letters"></asp:Label> </body> </html> Quote
fizzled Posted April 1, 2005 Posted April 1, 2005 Basically, just read up on CSS itself, and the use of the CssClass property will probably become evident. Quote
bri189a Posted April 1, 2005 Posted April 1, 2005 http://www.thenoodleincident.com/tutorials/css/index.html is great for layouts using Style sheets, and has lots of good links regarding CSS. CSS is one of the best things you can learn about for applying styles globably through an application. It's a core concept of web design IMHO. Quote
Administrators PlausiblyDamp Posted April 2, 2005 Administrators Posted April 2, 2005 http://www.w3schools.com/css/default.asp also has quite a nice tutorial on CSS, well worth spending some time reading. Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
joe_pool_is Posted April 4, 2005 Author Posted April 4, 2005 external file(s)? First, my apologies for over stepping the bounds in my colorful metaphors above. I simply wasn't paying attention. How to create CSS scripts seems straightforward enough, but I have never used a separate file for holding my scripts. Would the separate file need to begin with <html><script> (( other code here )) </script></html> or simply start with the first line reading ".style"? Web pages are a hobby of mine, but I've never included a separate text file for either JavaScript or CSS scripts. Thanks for the links, too! I will certainly be exploring them. Quote Avoid Sears Home Improvement
joe_pool_is Posted April 4, 2005 Author Posted April 4, 2005 Never mind. PlausiblyDamp's link has all the info I needed. Quote Avoid Sears Home Improvement
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.