Home  >  Article  >  Web Front-end  >  鼠标悬浮实现链接背景变色效果_html/css_WEB-ITnose

鼠标悬浮实现链接背景变色效果_html/css_WEB-ITnose

WBOY
WBOYOriginal
2016-06-24 11:29:542208browse

鼠标悬浮实现链接背景变色效果:
本章节分享一段代码实例,它能够实现鼠标悬浮链接实现背景变色效果。
代码实例如下:

<!DOCTYPE html><html><head><meta charset="utf-8"><meta name="author" content="http://www.softwhy.com/" /><title>蚂蚁部落</title><style type="text/css">a{  display:block;  width:140px;  height:30ox;   line-height:30px;  background-color:#94b8e9;  border:1px solid black;  color:#000;  text-decoration:none;  text-align:center;}a:hover{  background-color:#369;  color:#fff;}</style></head><body><a href="http://www.softwhy.com">蚂蚁部落</a></body></html>

以上代码实现了我们的要求,当鼠标悬浮设置背景色是利用了,链接伪类a:hover。

原文地址是:http://www.softwhy.com/forum.php?mod=viewthread&tid=13421

更多内容可以参阅:http://www.softwhy.com/divcss/

Statement:
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