How to make hover buttons?

前端 未结 5 591
借酒劲吻你
借酒劲吻你 2021-01-22 10:29

I want to make a CSS class so that i can use it like this


So how do I make a class so that

相关标签:
5条回答
  • 2021-01-22 11:01

    http://www.pixelmill.com/support/support_article.aspx?ParentListID=al1015&articleid=kb101543

    0 讨论(0)
  • 2021-01-22 11:21

    There are plenty of tutorials in the web:

    • CSS Hover Dynamic Button.
    0 讨论(0)
  • 2021-01-22 11:21

    Something like this:

    <style type="text/css">
      .some {
          background-color:#0F9;
      }
    
      .some:hover {
          background-color:#F00;
      }  
    </style>
    </head>
    
    <body>
    <div class="some"> dsadsad </div>
    </body>
    
    0 讨论(0)
  • 2021-01-22 11:24

    The easiest way is to use sprites. You'll need to change the <input> tags to <a> tags:

    <style>
    
    a.link1 {
    display:block;
    height:10px;
    background:url(image.jpg) no-repeat 0 0;
    }
    
    a.link1:hover {
    background:url(image.jpg) no-repeat 0 -10px;
    }
    
    </style>
    
    <a href="URL1" class="link1">foo</a>
    
    0 讨论(0)
  • 2021-01-22 11:24

    just apply these rules:

    .hoverbuttons { ... }
    .hoverbuttons:hover { ... }
    

    note: on IE6 and previous :hover pseudoclass will work only on <a> elements.

    0 讨论(0)
提交回复
热议问题