?

Log in

No account? Create an account

Previous Entry | Next Entry

Valid XHTML 1.0

Want to make an entire <div> into a link and still have your XHTML 1.0 document validate? Try this:
<a href="http://corknut.org"><ins><div> div contents go here </div></ins></a>


Because while <div> isn't allowed inside <a>, it is allowed inside <ins>, which in turn is allowed inside <a>. And it validates! How ridiculous.

Then make sure the div's style uses cursor: hand; so that it looks like a link to the visitor.

(Thanks to okb for figuring this out for me.)

Edit: Okay, better solution: <span> is allowed inside an <a>, and with the display: block; style it works the same as a <div>. So that's what I ended up using.

Comments

katre50
Jul. 13th, 2004 03:13 pm (UTC)
I'd just like to mention that I think "cursor: hand" is the worst thing ever. Thanks.

Latest Month

February 2011
S M T W T F S
  12345
6789101112
13141516171819
20212223242526
2728     

Page Summary

Powered by LiveJournal.com