Darken background image on hover

后端 未结 14 1517
囚心锁ツ
囚心锁ツ 2020-12-22 23:03

How would I darken a background image on hover without making a new darker image?

CSS:

.image {
  background: url(\         


        
14条回答
  •  死守一世寂寞
    2020-12-22 23:09

    try this

    http://jsfiddle.net/qrmqM/6/

    CSS

    .image {
        background: url('http://cdn1.iconfinder.com/data/icons/round-simple-social-icons/58/facebook.png');
        width: 58px;
        height: 58px;
          opacity:0.4;
    filter:alpha(opacity=40); /* For IE8 and earlier */
    }
    .image:hover{
        background: url('http://cdn1.iconfinder.com/data/icons/round-simple-social-icons/58/facebook.png');
        width: 58px;
        height: 58px;
    
        border-radius:100px;
      opacity:1;
                filter:alpha(opacity=100);
    
    }
    

    HTML

提交回复
热议问题