Rotating text with CSS3/HTML5

萝らか妹 提交于 2019-11-28 03:35:22

问题


I have a <span> that I want to rotate. I am using HTML5, CSS3, and Internet Explorer 9.

I tried the below CSS, but it's not working:

-webkit-transform: rotate(-90deg); 
-moz-transform: rotate(-90deg); 

How do I rotate the span?


回答1:


-webkit- and -moz- properties are for webkit browsers (Chrome, Safari) and Gecko browsers (Firefox) respectively.

You need to use the equivalent for IE as well.

.rotate {

/* Safari, Chrome */
-webkit-transform: rotate(-90deg);

/* Firefox */
-moz-transform: rotate(-90deg);

/* IE */
-ms-transform: rotate(-90deg);

/* Opera */
-o-transform: rotate(-90deg);

/* Older versions of IE */
filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=3);

/* CSS3 standard as defined here: http://www.w3.org/TR/css3-transforms/ */
transform: rotate(-90deg);

}

Source




回答2:


Try -ms-transform: rotate(-90deg);




回答3:


Inline elements can't be rotated. you have to display them as block level.



来源:https://stackoverflow.com/questions/11026200/rotating-text-with-css3-html5

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!