Adding background image to button using CSS

前端 未结 2 942
不思量自难忘°
不思量自难忘° 2020-12-18 06:43

I am trying to add a background image to a button (or link with the same class) which already has a background color.

Here is the jsfiddle: http://jsfiddle.net/BNvke/

相关标签:
2条回答
  • 2020-12-18 06:59

    see http://jsfiddle.net/BNvke/1/

    just change

    background-image url(http://i47.tinypic.com/2ni0ahd.png) 3px 5px no-repeat;
    

    with

    background: url(http://i47.tinypic.com/2ni0ahd.png) 3px 5px no-repeat;
    

    and move up the last rule so the rule about background-color defined for .button_blue can be applied on cascade

    0 讨论(0)
  • 2020-12-18 07:10
    .button {
        background: url(http://i47.tinypic.com/2ni0ahd.png);
        background-repeat: 3px 5px no-repeat;
    }
    
    0 讨论(0)
提交回复
热议问题