Reputation: 2405
stylesheet.css
body
{
font-family:Tahoma;
}
Label
{
font-family:Freestyle Script;
}
Hyperlink
{
font-family:Times New Roman;
}
TextBox
{
font-family:Tahoma;
}
index.aspx
<link rel="Stylesheet" href="StyleSheet.css" type="text/css" />
Its not being afffected for hyperlink & label and not setting different font for both.
My components are in
Upvotes: 0
Views: 1258
Reputation: 2581
ASP.NET renders html at client side and css is applied to html. You cannot use HyperLink , Label etc.
Label renders to <Span>
Hyperlink to <a>
TextBox to <Input>
try
a
{
font-family:Times New Roman;
}
input
{
font-family:Tahoma;
}
Instead, its better to assign ID's to them and use the ids to apply css.
Upvotes: 1
Reputation: 544
u can assign class to controls in aspx file as
<asp:TextBox ID="txtName" runat="server" CssClass ="txtInput" />
and in css file
.txtInput
{
font-family:Tahoma;
}
Upvotes: 0