简体   繁体   中英

SVGtransform:rotate() not working in ie9

我在块级元素中使用svg>我尝试使用transformrotate(180deg)旋转该块。这在Firefox和chrome和IE Edge中工作正常。当我打开IE9时,它不起作用。如何解决此问题。

IE9 does not support transform: rotate(180deg) , you must add -ms prefix to make element transform.

Code Sample: https://jsfiddle.net/s8hdhurc/

<html>
        <head>
            <meta http-equiv="X-UA-Compatible" content="IE=edge" />
            <!-- This is important as -ms-rotate does not work in quirks mode -->
            <style>
                .rotate {
                    -ms-transform: rotate(180deg); /* IE 9 */
                    -webkit-transform: rotate(180deg); /* Safari */
                    transform: rotate(180deg);
                }
            </style>
        </head>
        <body>
            <div class="rotate">
                <img src="http://upload.wikimedia.org/wikipedia/commons/b/b0/NewTux.svg">
            </div>
        </body>
    </html>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM