Solved

W3C reports error when using the csshover.htc

Posted on 2006-11-28
5
375 Views
Last Modified: 2008-01-09
I am using drop down horizontal navs (all CSS, no javascript) and have uploaded the csshover.htc to my server.
I'm using it in my background as such:
BODY{
      background:#6B8CB8 url(/images/mountains-only.gif) no-repeat 0% 0%;
      font:75% Arial,Helvetica,sans-serif;
      color:#10075A;
      text-align:center;
      behavior:url("/csshover.htc");
      margin:0;
      padding:0;
      background-position: 0% 0%;
}

But I receive a validation error from the W3C validation site that says:
Line: 7 Context : BODY
Property behavior doesn't exist : url("/csshover.htc")

What can I do? I need this drop down to work in IE and I would prefer not to use javascript to get them to work. Is this error fixable?
0
Comment
Question by:alabina
  • 2
  • 2
5 Comments
 
LVL 30

Expert Comment

by:Steggs
ID: 18033194
Greetings alabina,

The behavior property is a proposed addition by microsoft and is still a working draft at w3c http://www.w3.org/TR/becss. I believe it is supported in IE but it wont validate at w3c because it hasnt been approved by w3 yet.

Regards
0
 
LVL 30

Accepted Solution

by:
VirusMinus earned 500 total points
ID: 18033316
Steggs is right.

to fix this (to some extent) move your IE specific CSS into a seperate file or have it applied using conditional statements like so;

in your main css file, remove the behavior property from the BODY css.

then after your main css call and before you finish your </head> tag in your html

put this;

<!--[if IE]><style type="text/css">body{behavior:url("/csshover.htc");}</style><![endif]-->

this way, atleast your base CSS is valid
0
 
LVL 30

Expert Comment

by:Steggs
ID: 18033332
nice fix VM
0
 
LVL 30

Expert Comment

by:VirusMinus
ID: 18033438
also note, using .htc files is dependant on the client having javascript enabled. its similar to using javascript itself in code. If javascript is turned  off, your hover properties won't work in IE 6 and below
0
 

Author Comment

by:alabina
ID: 18044211
Thank you! That will do it.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
(URGENT) Help HTML and CSS Resizing Images 2 40
CSS Scroll Issue 3 91
Syntax Error 2 46
CSS Logo Problem. 2 8
Introduction If you're like most people, you have occasionally made a typographical error when you're entering information into an online form.  And to your consternation, the browser remembers the error, and offers to autocomplete your future entr…
SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
In this tutorial viewers will learn how to style elements, such a divs, with a "drop shadow" effect using the CSS box-shadow property Start with a normal styled element, such as a div.: In the element's style, type the box shadow property: "box-shad…
In this tutorial viewers will learn how to style a decorative dropcap for the first letter in a paragraph using CSS. In CSS, create a new paragraph class by typing "p.fancy": Then, to style only the first letter of the first sentence, include the ps…

895 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now