CSS如何实现超链接背景切换_html/css_WEB-ITnose

WBOY
Release: 2016-06-24 11:39:04
Original
1730 people have browsed it

CSS如何实现超链接背景切换:

相当数量的网站在导航栏都有如此效果:当鼠标放在导航栏目上,背景图片会发生变化,移开之后又会还原原来的背景图片。下面简单介绍一下如何实现此效果。代码实例如下:

 

 

蚂蚁部落
Copy after login

以上代码实现了我们的要求。实现的过程非常简单:

第一步,将超链接的默认状态下设置一个背景图片。

第二部,在鼠标放到超链接上的时候设置成另一张背景图片。

注意:a元素必需要转换成块级元素,否则无法设置高度和宽度。

原文地址是:http://www.51texiao.cn/div_cssjiaocheng/2015/0508/938.html

最为原始地址是:http://www.softwhy.com/forum.php?mod=viewthread&tid=4683

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!