2014-07-08 40 views
2

如何爲所有瀏覽器定製聚合物一次? 現在我必須寫爲Chrome/Opera和Firefox兩個CSS版本:定型聚合物 - 一次適用於所有瀏覽器

.leftSide img{ 
    float: left; 
    width: 100px; 
} 
content[select=".poster"]::content img { 
    float: left; 
    width: 100px; 
} 

HTML:

 <div class="leftSide"> 
       <content select=".poster"></content> 
     </div> 

這僅適用於新的Opera和Chrome瀏覽器:

content[select=".poster"]::content img 

該作品只在Firefox上:

.leftSide img{ 
    float: left; 
    width: 100px; 
} 

那麼,有沒有選擇編寫代碼一次?

回答

1

你試過polyfill-next-selectorDocumentation for it here

有了,你應該能夠做到:

polyfill-next-selector {content: ':host .leftSide img';} 
content[select=".poster"]::content img { 
    float: left; 
    width: 100px; 
} 
相關問題