Home > Web Front-end > HTML Tutorial > css实现的鼠标滑过星星高亮效果_html/css_WEB-ITnose

css实现的鼠标滑过星星高亮效果_html/css_WEB-ITnose

WBOY
Release: 2016-06-24 11:28:51
Original
1040 people have browsed it

css实现的鼠标滑过星星高亮效果:
关于星星评分效果大家一定都不会陌生,当鼠标滑过的时候会使相应的星星变得高亮,下面就介绍一下如何利用css实现此功能,当然并不是完整的评分功能,仅仅是如何使滑过的星星实现高亮效果。
代码实例如下:

<!DOCTYPE html><html><head><meta charset=" utf-8"><meta name="author" content="http://www.softwhy.com/" /><title>蚂蚁部落</title><style type="text/css"> *{   margin:0;   padding:0; } span{   display:block;   width:30px;   height:30px;   padding-left:30px;   background-image:url(mytest/demo/star.gif);   background-repeat:no-repeat;   background-position:0 -3px; } span span span span span{   padding-left:0; } span:hover{   background-position:0 -31px; } </style> </head><body><span>  <span>    <span>       <span>         <span></span>       </span>    </span>   </span> </span></body></html>
Copy after login

上面的代码实现了我们的要求当鼠标滑过的时候能够实现五角星高亮效果。

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

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

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