Can you use CSS to mirror/flip text?

后端 未结 14 2343
旧时难觅i
旧时难觅i 2020-11-28 01:27

Is it possible to use CSS/CSS3 to mirror text?

Specifically, I have this scissors char “✂” () that I\'d like to display pointing left a

14条回答
  •  天涯浪人
    2020-11-28 01:58

    You can use CSS transformations to achieve this. A horizontal flip would involve scaling the div like this:

    -moz-transform: scale(-1, 1);
    -webkit-transform: scale(-1, 1);
    -o-transform: scale(-1, 1);
    -ms-transform: scale(-1, 1);
    transform: scale(-1, 1);
    

    And a vertical flip would involve scaling the div like this:

    -moz-transform: scale(1, -1);
    -webkit-transform: scale(1, -1);
    -o-transform: scale(1, -1);
    -ms-transform: scale(1, -1);
    transform: scale(1, -1);
    

    DEMO:

    span{ display: inline-block; margin:1em; } 
    .flip_H{ transform: scale(-1, 1); color:red; }
    .flip_V{ transform: scale(1, -1); color:green; }
    Demo text ✂
    Demo text ✂

提交回复
热议问题