如何单击使用CSS单击更改图像? [英] How to change an image on click using CSS alone?
本文介绍了如何单击使用CSS单击更改图像?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个图像,当图像被点击时,我想显示下面的另一个图像。我正在寻找一个简单的CSS解决方案。
I have an image and when the image is clicked I want to reveal another image below it. I am looking for a simple CSS only solution.
是否可能?
推荐答案
您可以使用具有不同样式的< a>
标记:
You could use an <a>
tag with different styles:
a:link { }
a:visited { }
a:hover { }
a:active { }
我建议与CSS sprites一起使用: http:/ /css-tricks.com/158-css-sprites/
I'd recommend using that in conjunction with CSS sprites: http://css-tricks.com/158-css-sprites/
这篇关于如何单击使用CSS单击更改图像?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文