Hovering <a> in CSS without href

I need an image that needs to be changed, hanging above it. I got this working in CSS by changing the z-index while hovering over it. However, I do not want anyone to click on it. So I removed href from the tag. I heard that this is a problem for IE6, however I read that it complies even with XHTML specifications, which confirms my code. So, is there any work for IE6 due to the lack of href? Does anyone here have IE6 that can check this out and see if this is really a problem?

+3
source share
6 answers

Maybe u should

href="#"

"" "";)

+6

name

<a name="changingimage">...</a>
+1

IE6 :hover (. :link s > ) , , href. , href , :link.

, href , JavaScript .

+1

IE 6, , PNG script, , . , " ", . - ​​ .

0
source

Another thing you can do is use the background in the css + anchor tag to display this hover effect:

<style>
    a#test{
        background:#ff0000;
    }
    a#test:hover{
        background:#0000ff;
    }
</style>
<a id="test" href="#" style="width:100px;height:100px;display:block;" >test</a>

This will make one square with a red background, and when you move the background over it, it will turn blue. Ofc you can put the background image there and the images will change ... :)

0
source

Use javascript void function

text

Will do exactly what you need.

-1
source

Source: https://habr.com/ru/post/1717015/


All Articles