Forum Moderators: open

Message Too Old, No Replies

Hyperlinked DIV creating Validator error?

         

JAB Creations

8:59 pm on Aug 22, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



document type does not allow element "div" here; missing one of "button", "map", "object", "ins", "del", "noscript" start-tag.

I basically have...

<a href="#"><div></div></a>

I'm sure there is something I'm not aware of, what is it and how do I do it correctly?

tedster

9:17 pm on Aug 22, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



<div> is a block level element - and <a> is an inline element. Inline elements cannot contain block level children.

What you need to do depends on what you are planning to achieve on the page. The smallest change would be to reverse the nesting:

<div><a href="#"></a></div>

If you are trying to get hover behavior on an entire div, IE doesn't do that, although there are some workarounds. Some time researching the CSS Forum can turn up solutions for some cases, for example.

Can hover make other elements visible? [webmasterworld.com]