Solved

W3C reports error when using the csshover.htc

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Creating a CSS block that only applies to printing By default, all of your CSS applies to every possible view of your page - whether on screen, printed, landscape, touch-screen, or whatever.  You can, however, add CSS that only applies under certai…
When applying CSS to your HTML, there are many different ways to select which element(s) the CSS applies to.  Some of these selectors are more commonly known and used than others - Here are the more common ones: #X - Matches an ID of X .X - Matche…
In this Micro Tutorial users will learn how to embed custom fonts into websites using @font-face in CSS Select a font: Ensure the EULA allows you to use @font-face: Download the font: Get the browser-compatible files you need: Edit your CSS       - Name …
In this tutorial viewers will learn how to position items using CSS's three positioning types Create a new HTML document with an internal stylesheet.: Create another div in CSS and name it Absolute : Type "position:absolute;" and "top:10px; left:50p…

758 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

21 Experts available now in Live!

Get 1:1 Help Now