How to rotate + flip element with CSS

后端 未结 4 597
长发绾君心
长发绾君心 2020-12-24 12:29

The transform property lets you rotate or flip, but how can you do both at the same time? Say I want to rotate an element 90 degrees and flip it horizontally? Both are don

4条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-24 12:30

    I fiddled with jsfiddle, and this worked:

    $('#photo').css('transform', 'rotate(90deg) scaleX(-1)');
    

    To relate it to your question, the resulting CSS looks like

    transform: rotate(90deg) scaleX(-1);
    

提交回复
热议问题