Forum Moderators: not2easy
here's the CSS code
div {
overflow: hidden;
cursor: crosshair;
background-repeat: no-repeat;
}
div.QnA {
background-image: url(../images/07.png);
width: 45px;
height: 12px;
}
div.QnA:hover {
background-image: url(../images/07_7.png);
width: 45px;
height: 12px;
}
in HTML it has the following
<td colspan="4"><a href="QnA.php" target="content"><div class="QnA"></div></a></td>
2 problems, IE doesn't like css hovering, and it seems that div containers don't like to be empty?
how can i solve both problems effectively? ;-/
i have come across other threads which are similar like this one [webmasterworld.com] and this too [webmasterworld.com] but rather, both of 'em do not have the main difference that i've hacked... ;-/
any help appreciated... ^^
What you can't do, however, is put a div inside an anchor element [validator.w3.org]. The div is a block level element, and as such it is not allowed within the anchor, which is an inline element.
it would be great if someone can help me with an alternative to the div anchor problem...
since i wouldlike to stay away from javascript, i can't seem to crack my head open in finding another solution in making this world well.
any suggestions is appreciated... ^^
<td onmouseover="this.style.background='url(../images/07.png)';" onmouseout="this.style.background='url(../images/07_7.png)';" onclick="location.href='QnA.php';" style="cursor:hand;">Your text here with a <a href="QnA.php">standard link</a> for when JS is disabled</td> It's messy, but it validates, and could be what you're looking for.
1) Use a transparent gif, and change the "background" of it using CSS
a:hover img { background-image: url(foobar.gif); }
2) Use a span tag instead of the div tag. It validates, and it serves the same purpose. If a forced line break is important, assign display:block to both the anchor and the span
one last problem... >.<
css doesn't seem to fully load everything, so whenever the mouse moves over the img, it needs to load up. should the external css supposed to finish loading in the background by the time the page is up? 'cuz i've tested by also waiting for a while before going over the img, and yet it still doesn't load up... ;-/
is there a good fix around it?