2015-04-17 82 views
0

爲什麼firefox拒絕轉換元素?我該如何解決?Firefox拒絕轉換元素

.config:before 
{ 
    content: 'test'; 
    font: 25px/55px serif; 
    -webkit-transition: .6s -webkit-transform ease-in-out; 
      transition: .6s transform ease-in-out; 
} 

.config.active:before 
{ 
    -webkit-transform: rotate(360deg); 
     -ms-transform: rotate(360deg); 
      transform: rotate(360deg); 
} 

<span class="config active"></span> 

JSBin:http://jsbin.com/zipokubode/1/edit?html,css,output

注:我運行最新的穩定FF,所以前綴不是問題。

回答

1

您需要更改僞佈局比賽:http://jsbin.com/xutesahiqe/1/edit?html,css,output

這裏display:inline-block;應該罰款。

.config 
{ 
    cursor: pointer; 
     display:inline-block; 
} 

.config:before 
{ 
    font: 25px/55px serif; 
    display:inline-block; 
    content: 'test'; 
    -webkit-transition: .6s -webkit-transform ease-in-out; 
      transition: .6s transform ease-in-out; 
} 

.config.active:before 
{ 
    -webkit-transform: rotate(360deg); 
     -ms-transform: rotate(360deg); 
      transform: rotate(360deg); 
} 
<span class="config"></span>