2013-02-12 83 views
0

为什么CSS3变换不能在(锚)元素上工作?使用变换旋转'a'元素

<a id="a" href="#">Rotate This</a> 
#a 
{ 
    transform:rotate(7deg); 
    -ms-transform:rotate(7deg); 
    -moz-transform:rotate(7deg); 
    -webkit-transform:rotate(7deg); 
    -o-transform:rotate(7deg); 
} 

回答

0

工作,你可以用在DIV你的锚,然后旋转。 Fiddle

<div><a id="a" href="#">Rotate This</a></div> 

@Byscripts说对了,内联元素例如a,span不支持转换。

+0

不需要添加div。只需将'display:block;'应用于''元素即可。 – ByScripts 2013-02-12 13:16:54

2

旋转不上内联元素

+0

对,只需将您的锚点变成块,您应该能够旋转。 – AndyBean 2014-04-04 22:49:59