Heim  >  Artikel  >  Web-Frontend  >  鼠标悬浮实现链接背景变色效果_html/css_WEB-ITnose

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

WBOY
WBOYOriginal
2016-06-24 11:29:542209Durchsuche

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

<!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/

Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn