Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ASP.Net and CSS (Simple Question ;-)

Status
Not open for further replies.

chrigil

Programmer
Sep 23, 2003
178
GB
Can anyone tell me if it is possible to use CSS with ASP.Net without writing it 'inline'?

All the examples I have seen use CSS inline and with the small experimentation I have tried using separate StyleSheets and Classes but without success.

Any ideas



Thanks in advance,

Chris
 
Yes you can use seperate stylesheets.

The pages are rendered as HTML so really there is no difference in using ASP.NET with stylesheets and using HTML with stylesheets. You can just add your link to the sheet as normal e.g.
Code:
<LINK REL="stylesheet" TYPE="text/css" HREF="MyStyles.css">

You can also apply styles to server controls. For more info on this try MSDN at:


Hope this helps.



----------------------------------------------------------------------

Need help finding an answer?

Try the search facilty ( or read FAQ222-2244 on how to get better results.
 
all the web controls you are using use cssClass

like so:

<asp:ImageButton CssClass="mainPicture" id="ImageButton1" runat="server">

wbochar
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top