Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

W3C reports error when using the csshover.htc

Posted on 2006-11-28
5
Medium Priority
?
392 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 30

Expert Comment

by:Mark Steggles
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 2000 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:Mark Steggles
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

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

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

Introduction A frequently asked question goes something like this:  "I am running a long process in the background and I want to alert my client when the process finishes.  How can I send a message to the browser?"  Unfortunately, the short answer…
This is a how to build your own CSS3 slideshow and when I say CSS3 I mean just CSS with no javascript in sight! There a few examples online of how to do this but most just show you an example without any explanation, others make it more complicat…
In this tutorial viewers will learn how to style transparent/translucent elements using alpha transparency in CSS Start with a normal styled element, such as a div.: Define its "background-color" property as "rgba (255, 255, 255, .5): The numbers in…
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…
Suggested Courses

670 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