I was just wondering if this method is a best practice.
<a href=""> <div id="hoverDiv"></div> </a>
It works, and I don't have to use <img> tags. I don't know if it passes w3schools validation and I don't know of I would change even if it didn't. You guys have any thoughts?
Linking a hover div
Moderator: General Moderators
-
maneetpuri
- Forum Commoner
- Posts: 60
- Joined: Tue Oct 07, 2008 6:32 am
Re: Linking a hover div
Hello friend,
I don,t think that there would be any problem in this code from the W3C validation point of view....
Good Luck!
I don,t think that there would be any problem in this code from the W3C validation point of view....
Good Luck!
Re: Linking a hover div
DIV is block element and A is inline element, blocks elements can't be children of inline elements.
Instead of DIV use SPAN (which is also inline element) together with CSS:
Instead of DIV use SPAN (which is also inline element) together with CSS:
Code: Select all
#hoverDiv {
display: inline-block;
/* Rest of stuff ... */
}