Flipping/Inverting/Mirroring text using css only

前端 未结 2 1854
轻奢々
轻奢々 2020-12-04 16:33

I did some googling and here\'s my answer

相关标签:
2条回答
  • 2020-12-04 16:56

    to mirror use transform: scaleX(-1); to flip use rotate(180deg);

    0 讨论(0)
  • 2020-12-04 17:01

    Your code is correct but there is an easier way to do this:

    img.flip {
      -moz-transform:    scaleX(-1); /* Gecko */
      -o-transform:      scaleX(-1); /* Opera */
      -webkit-transform: scaleX(-1); /* Webkit */
      transform:         scaleX(-1); /* Standard */
    
      filter: FlipH;                 /* IE 6/7/8 */
    }
    

    I think this solves your centered mirroring issue.

    As noted you will have to set the element to use a display of block, inline-block etc.

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