CSS with links

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
User avatar
SpecialK
Forum Commoner
Posts: 96
Joined: Mon Sep 18, 2006 3:49 pm

CSS with links

Post 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.
User avatar
arjan.top
Forum Contributor
Posts: 305
Joined: Sun Oct 14, 2007 4:36 am
Location: Hoče, Slovenia

Re: CSS with links

Post by arjan.top »

set link display to block

Code: Select all

display: block;
Post Reply