Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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.

Posted

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>

Posted

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.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...