国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 開發 > CSS > 正文

詳談IE條件注釋

2024-07-11 08:36:44
字體:
來源:轉載
供稿:網友

概述

如果你厭煩了為低版本IE寫又臭又長的hack,IE條件注釋將是比較優美的解決方法。當然條件注釋的功能不僅僅是以上那些功能,除了規避寫出惡心的hack,它還可以針對不同的IE版本(IE5.5-9,IE10不支持條件注釋)做出不同的相應,比如針對不同IE加載不同的樣式,或者腳本等等,更多的功能等待我們的發掘和運用。

條件注釋簡介

IE中的條件注釋(Conditional comments)對IE的版本和IE非IE有優秀的區分能力,是WEB設計中常用的hack方法。
條件注釋只能用于IE5以上,IE10以上不支持。
如果你安裝了多個IE,條件注釋將會以最高版本的IE為標準。
條件注釋的基本結構和HTML的注釋(<!– –>)是一樣的。因此IE以外的瀏覽器將會把它們看作是普通的注釋而完全忽略它們。
IE將會根據if條件來判斷是否如解析普通的頁面內容一樣解析條件注釋里的內容。

條件注釋語法

項目范例說明
![if !IE]The NOT operator. This is placed immediately in front of the featureoperator, or subexpression to reverse the Boolean meaning of the expression.
NOT運算符。這是擺立即在前面的功能操作員,或子表達式扭轉布爾表達式的意義。
lt[if lt IE 5.5]The less-than operator. Returns true if the first argument is less than the second argument.
小于運算符。如果第一個參數小于第二個參數,則返回true。
lte[if lte IE 6]The less-than or equal operator. Returns true if the first argument is less than or equal to the second argument.
小于或等于運算。如果第一個參數是小于或等于第二個參數,則返回true。
gt[if gt IE 5]The greater-than operator. Returns true if the first argument is greater than the second argument.
大于運算符。如果第一個參數大于第二個參數,則返回true。
gte[if gte IE 7]The greater-than or equal operator. Returns true if the first argument is greater than or equal to the second argument.
大于或等于運算。如果第一個參數是大于或等于第二個參數,則返回true。
( )[if !(IE 7)]Subexpression operators. Used in conjunction with boolean operators to create more complex expressions.
子表達式運營商。在與布爾運算符用于創建更復雜的表達式。
&[if (gt IE 5)&(lt IE 7)]The AND operator. Returns true if all subexpressions evaluate to true
AND運算符。如果所有的子表達式計算結果為true,返回true
|[if (IE 6)|(IE 7)]The OR operator. Returns true if any of the subexpressions evaluates to true.
OR運算符。返回true,如果子表達式計算結果為true。
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 安多县| 布拖县| 随州市| 农安县| 吴川市| 荣成市| 绥滨县| 达尔| 福安市| 仙游县| 北碚区| 金沙县| 固原市| 施甸县| 南京市| 冀州市| 沙湾县| 楚雄市| 连江县| 华坪县| 云霄县| 柏乡县| 江永县| 门源| 桐城市| 韶山市| 碌曲县| 孟津县| 比如县| 兴安县| 日土县| 聊城市| 龙岩市| 林口县| 盐城市| 天门市| 洞口县| 修文县| 紫阳县| 左贡县| 孝昌县|