1、<style>ul#nav{margin:0 auto; text-align:center;}ul#nav li{display:inline-block;}a{ text-decoration:none; color:gray; padding:0 20px;}span{width:36px; height:30.5px; display:inline-block;}#p1{ background:url(icons.png) no-repeat left -5px;}#p2{ background:url(icons.png) no-repeat 0 -66px;}#p3{ background:url(icons.png) no-repeat 0 -126px;}#p4{ background:url(icons.png) no-repeat 0 -186px;}#p5{ background:url(icons.png) no-repeat 0 -246px;}a:hover #p1{ background:url(icons.png) no-repeat 0 -36px;}a:hover #p2{ background:url(icons.png) no-repeat 0 -96px;}a:hover #p3{ background:url(icons.png) no-repeat 0 -156px;}a:hover #p4{ background:url(icons.png) no-repeat 0 -216px;}a:hover #p5{ background:url(icons.png) no-repeat 0 -276px;}#nav li a:hover {color:red;}</style>
2、<body><ul id="nav"> <li><a href="#"><span id="p1"></span>微信官号</a></li> <li><a href="#"><span id="p2"></span>RSS订阅</a></li> <li><a href="#"><span id="p3"></span>微博官号</a></li> <li><a href="#"><span id="p4"></span>首页回顾</a></li> <li><a href="#"><span id="p5"></span>建议反馈</a></li></ul></body>