How to flip background image using CSS?

后端 未结 5 2151
盖世英雄少女心
盖世英雄少女心 2020-12-04 05:29

How to flip any background image using CSS? Is it possible?

currenty I\'m using this arrow image in a background-image of li in css

5条回答
  •  余生分开走
    2020-12-04 06:18

    I found I way to flip only the background not whole element after seeing a clue to flip in Alex's answer. Thanks alex for your answer

    HTML

    
    
    

    CSS

    .next a, .prev a {
        width:200px;
        background:#fff
    }
     .next {
        float:left
    }
     .prev {
        float:right
    }
     .prev a:before, .next a:before {
        content:"";
        width:16px;
        height:16px;
        margin:0 5px 0 0;
        background:url(http://i.stack.imgur.com/ah0iN.png) no-repeat 0 0;
        display:inline-block 
    }
     .next a:before {
        margin:0 0 0 5px;
        transform:scaleX(-1);
    }
    

    See example here http://jsfiddle.net/qngrf/807/

提交回复
热议问题