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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Non Valid W3C CSS Validator Results 1

Status
Not open for further replies.

itguyz23

Programmer
Apr 28, 2005
1
US
I have a button coded as follows:
<input type="button" value="Blog Sign In" class="btn" onclick="location.href=' />

I also have a CSS file that I use, where I define btn as:
input.btn {
color:#31417B;
font-family:'trebuchet ms',helvetica,sans-serif,arial;
font-size:84%;
font-weight:normal;
background-color:#CECFCE;
border:1px solid;
border-top-color:#FFF;
border-left-color:#FFF;
border-right-color:#FFF;
border-bottom-color:#FFF;
filter:progid:DXImageTransform.Microsoft.Gradient (GradientType=0,StartColorStr='#ffffffff',EndColorStr='#CECFCE');
}

I'm receiving the following errors when trying to validate:
Line: 310 Context : input.btn
attempt to find a semi-colon before the property name. add it

Line: 310 Context : input.btn
Property progid doesn't exist : DXImageTransform

Line: 310 Context : input.btn
Parse Error - DXImageTransform.Microsoft.Gradient (GradientType=0,StartColorStr='#ffffffff',EndColorStr='#CECFCE');

Line: 311 Context : input.btn
Parse error - Unrecognized : }


Any ideas what I'm doing wrong in my CSS sheet? Thanks so much for your help!
 
Line: 310 Context : input.btn
attempt to find a semi-colon before the property name. add it
Sounds like the previous css declaration is missing a semi-colon.
Line: 310 Context : input.btn
Property progid doesn't exist : DXImageTransform

Line: 310 Context : input.btn
Parse Error - DXImageTransform.Microsoft.Gradient (GradientType=0,StartColorStr='#ffffffff',EndColorStr='#CECFCE');

Line: 311 Context : input.btn
Parse error - Unrecognized : }
Filter is MicroSoft specific - it's implementation IS NOT standards compliant.

The solution is to embed it in the html file using conditional comments as follows:
Code:
<!--[if IE]>

  <style type="text/css">
    .btn { filter:progid:DXImageTransform.Microsoft.Gradient (GradientType=0,StartColorStr='#ffffffff',EndColorStr='#CECFCE');
  </style>

<!EndIf-->
Because the code is embedded with comments tags, it's not parsed by the validator for validity. But because these are MicroSoft specific conditional comments, IE will read and parse whats between the comments.

<marc>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top