百度空间 | 百度首页 
 
查看文章
 
闲来小研css sprite from:www.alistapart.com/articles/sprites
2009-06-11 08:42
<html>
<head>
<link rel="stylesheet" href="css.css" type="text/css" media="all" />
</head>
<body>
<ul id="skyline">
    <li id="panel1b"><a href="#1"></a></li>
    <li id="panel2b"><a href="#2"></a></li>
    <li id="panel3b"><a href="#3"></a></li>
    <li id="panel4b"><a href="#4"></a></li>
</ul>
</body>
</html>
/*下面是css*/
#skyline {
    width: 400px; height: 200px;
    background: url(test-3.jpg);
    margin: 10px auto; padding: 0;
    position: relative;}
#skyline li {
    margin: 0; padding: 0; list-style: none;
    position: absolute; top: 0;}
#skyline li, #skyline a {
    height: 200px; display: block;}
    #panel1b {left: 0; width: 95px;}
#panel2b {left: 96px; width: 75px;}
#panel3b {left: 172px; width: 110px;}
#panel4b {left: 283px; width: 117px;}
#panel1b a:hover {
    background: transparent url(test-3.jpg)
    0 -200px no-repeat;}
#panel2b a:hover {
    background: transparent url(test-3.jpg)
    -96px -200px no-repeat;}
#panel3b a:hover {
    background: transparent url(test-3.jpg)
    -172px -200px no-repeat;}
#panel4b a:hover {
    background: transparent url(test-3.jpg)
    -283px -200px no-repeat;}
(此图片:test-3.jpg)

类别:Web | 添加到搜藏 | 浏览() | 评论 (0)
 
最近读者:
 
网友评论:
发表评论:
姓 名:
网址或邮箱: (选填)
内 容:
验证码: 请点击后输入四位验证码,字母不区分大小写
      

     

©2009 Baidu