Solved

W3C reports error when using the csshover.htc

Posted on 2006-11-28
5
381 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: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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

CSS3 Custom checkboxes This article shows how to style the checkbox form element using only CSS. Works in: Chrome, FF, Safari, Opera, IE9+ Uses modernizr.js to check for :checked pseudo class, falling back to plain old checkboxes (IE8 and bel…
So you have coded your own WordPress plugin and now you want to allow users to upload images to a folder in the plugin folder rather than the default media location? Follow along and this article will show you how to do just that!
In this tutorial viewers will learn how to position overlapping items using z-index in CSS. They will also learn the restrictions on the z-index property.  Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Red.…
In this Micro Tutorial viewers will learn how to create a CSS image sprite (In a later tutorial, viewers will learn how to use CSS and HTML to create a navigation menu using this sprite) Open a new Photoshop document with a width of (Icon width)x(N…

739 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