Monthly Archives: 十一月 2008

CSS实现星级评分效果

利用z-index和相对定位,自己看例子去琢磨: /examples/star.html HTML+CSS代码: <!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”> <html xmlns=”http://www.w3.org/1999/xhtml”> <head> <meta http-equiv=”Content-Type” content=”text/html; charset=utf-8″ /> <title>CSS实现星级评分</title> <style type=”text/css”> ul,li {margin:0; padding:0; list-style:none;} #star {position:relative;width:95px;height:19px;overflow:hidden;} #star li {display:inline;} #star {background:url(images/star.png);} #star_1, #star_2, #star_3, #star_4, #star_5, #current {position:absolute; top:0; left:0; display:block; height:19px; text-indent:-9999px; outline:none;} #current {background:url(images/star.png) 0 -19px;} #star_1:hover, #star_2:hover, #star_3:hover, #star_4:hover, #star_5:hover [...]