2017-06-12 23 views
0

在TYPO3中爲Internet Explorer添加特定css是否有最佳做法?用於IE的TYPO3特殊CSS文件

我想這個模板:

<!--[if IE]> 
    <link href="fileadmin/config/script/css/ieCSS.css" rel="stylesheet" type="text/css" > 
<![endif]--> 

但它沒有效果...

感謝

回答

1

從官方文檔:https://docs.typo3.org/typo3cms/TyposcriptReference/6.2/Setup/Page/Index.html#includecss-array

page.includeCSS{ 
    ieStyle = fileadmin/config/script/css/ieCSS.css 
    ieStyle.allWrap = <!--[if IE]>|<![endif]--> 
    ieStyle.excludeFromConcatenation=1 
} 

您正在使用什麼版本的Internet Explorer?

+0

該解決方案的工作很好的問題是有條件的聲明沒有在IE 10和11工作...解決了問題js – Felix

+0

謝謝;)對不起,這個問題 – Felix

+0

不要感到抱歉。 AFAIK IE10 +根本不支持條件註釋。 –

1

模板normaly只讓內容在身體標記包括。
css聲明和您的IE-Conditions必須位於標題標籤中。

這樣的解決方案是使用的可能性,聲明自己的頭數據:

page { 
    headerData { 
     10 = TEXT 
     10 (
      <!--[if IE]> 
      <link href="fileadmin/config/script/css/ieCSS.css" rel="stylesheet" type="text/css" > 
      <![endif]--> 
     ) 
    } 
} 
+0

語句打印在HEAD中,但css在IE中無效 – Felix

+0

您是否知道:'IE10和IE11中不再支持條件註釋。'(來自https://en.wikipedia.org/wiki/Conditional_comment) –

+0

是的,我昨天在意上面感謝 – Felix