Page 1 of 1

CSS with links

Posted: Fri May 16, 2008 1:49 pm
by SpecialK
I have a site that I inherited which has buttons that are using mouseovers to create other images (not even using sprites)

I would like to change these "buttons" to text but when I came up with an idea, the web standards doesn't comply.

Code: Select all

<a href='x' class='y'><div class='z'>My link</div></a>
I did it this way so when you are over any part of the div, it treats it like a link. I need that empty area to continue to be treated like a link, not just the text. Now this code is working, but I was wondering if there is a better solution that doesn't conflict with web standards.

The error I get is (from FF2 html validator extension): Document type does not allow element ... here; missing one of ... start-tag
which is caused because DIV is a block element and A is inline.

Re: CSS with links

Posted: Fri May 16, 2008 2:46 pm
by arjan.top
set link display to block

Code: Select all

display: block;