Simple CSS doesnt work

eramgarden

Contributor
Joined
Mar 8, 2004
Messages
579
This is my first attempt at CSS..

1. I have an "ascx" file. Added this line to it:
Code:
<%@ Control Language="vb" AutoEventWireup="false" Codebehind="SideMenu.ascx.vb" Inherits="ASPApp.SideMenu" TargetSchema="http://schemas.microsoft.com/intellisense/ie5" %>
[b]<LINK href="Styles.css" type="text/css" rel="stylesheet">[/b]

2. Added a button with this line:
Code:
<TR bgColor="lightslategray">
		<TD align="middle" colSpan="1" height="50" rowSpan="1"><asp:button id="btnHome" runat="server" Text="Home" Font-Bold="True" [b]CssClass="ButtonStyle" [/b]></asp:button></TD>
	</TR>

3. Added a CSS Class:
Code:
.ButtonStyle
{
	
	height : 50px;
	width : 150px;
	
}

But the Height and Width arent being read from the CSS file. In my .Net book, it has to put the "link" in between <HEAD>...but i do NOT have a <HEAD> tag in ascx file..

What am I missing??
 
You use external CSS file in user control?

Please do remember user control not independ, so it's URL is follow the webform you tie to. In your case, I suspect your webform and user control not located in same directory, so the system can't found the actual CSS file.

Hope you understand what I talking about... :)
 
Back
Top