Help with CSS

HLRosenberger
HLRosenberger used Ask the Experts™
on
I've create a new VS project.   I've added two styles to the Site.css file.  I using them in two controls, however the style does not get applied. What am I doing wrong?



<asp:RequiredFieldValidator runat="server"
                    ID="NameRequired"
                    ControlToValidate="NameTextBox"
                    ErrorMessage="<b>Please enter a name.</b><br /> This is a required field."
                    Display="None" CssClass="errorMessage" />

             <asp:ValidatorCalloutExtender runat="Server"
                    ID="NameExtender"
                    TargetControlID="NameRequired"
                    HighlightCssClass="validatorCalloutHighlight" />


.errorMessage  
{
    background-color: #FFFF00;
}

.validatorCalloutHighlight {
    background-color: #FF0000;
    color: #034af3;
}
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Did you link the stylesheet to the page?

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
    <link href="Site.css" rel="stylesheet" type="text/css" />
</asp:Content>
Miguel OzSenior Software Engineer
Top Expert 2009
Commented:
As stated in previous comment , you need to link the style sheet to the page.
Also you need to check which styles are applied in your browser, for example  in IE use developer tools ( press F12 in IE window) and find out which CSS class is applied to your target controls.

Author

Commented:
Where is that code placed within the aspx?
Announcing the Winners!

The results are in for the 15th Annual Expert Awards! Congratulations to the winners, and thank you to everyone who participated in the nominations. We are so grateful for the valuable contributions experts make on a daily basis. Click to read more about this year’s recipients!

Author

Commented:
got it working.  thanks.

Author

Commented:
thanks
Right after the "Page" definition:

<%@ Page Language="VB" MasterPageFile="~/MasterPage.master" AutoEventWireup="false" CodeFile="ClaimHistory.aspx.vb" Inherits="ClaimHistory" title="Claim History" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
    <link href="StyleSheet.css" rel="stylesheet" type="text/css" />
</asp:Content>

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial