適用於移動第一響應網站。我正在合併HTML5 Boiler plate和Mobile Boilerplate如何將這2個IE條件語句合併爲一個?
我有一個小問題。
如何將這2個IE條件語句合併爲一個?
<!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]-->
<!--[if (gt IEMobile 7)|!(IEMobile)]><!--> <html class="no-js"> <!--<![endif]-->
適用於移動第一響應網站。我正在合併HTML5 Boiler plate和Mobile Boilerplate如何將這2個IE條件語句合併爲一個?
我有一個小問題。
如何將這2個IE條件語句合併爲一個?
<!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]-->
<!--[if (gt IEMobile 7)|!(IEMobile)]><!--> <html class="no-js"> <!--<![endif]-->
你有沒有嘗試這一個:
<!--[if (gt IE 8)|((gt IEMobile 7)|!(IEMobile))]><!-->
<html class="no-js">
<!--<![endif]-->
據我所知應該是可以添加另一對括號,並用or
運營商將它們結合起來。
順便說一句,我不認爲這是一個好主意,以這種方式操縱html
標籤。
有關詳細信息,請參閱http://en.wikipedia.org/wiki/Conditional_comment。
您可以將邏輯表達式與ands和ors組合(分別爲&
和|
)。
所以嘗試:
<!--[if (gt IE 8)|(gt IEMobile 7)|!(IEMobile)]><!--> <html class="no-js"> <!--<![endif]-->
我喜歡它,當有人打我時,我會給出一個錯誤的答案。我確信這是不可能的。 –
<!--[if gt IE 8 |((gt IEMobile 7)|!(IEMobile))]><!--> <html class="no-js"> <!--<![endif]-->
來源: http://msdn.microsoft.com/en-us/library/ms537512(v=vs.85).aspx
不是一個好主意來操縱這種方式,爲什麼呢? – Legends