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

首頁 > 開發 > CSS > 正文

瀏覽器特定的CSS Hacks匯總

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

我不再使用CSS Hacks了,相反的是,我將使用IE的條件判斷將類應用到body標簽。
 
但是,我想記錄我之前碰到過的每一個瀏覽器特定的CSS 選擇器和樣式屬性。我相信也沒有其他方式提供樣式表給獨特的Safari.
 
利用這些CSS Hacks,你能夠更好的針對IE、Chrome、Firefox、Opera和Safari,代碼如下:
 
瀏覽器特定的CSS Hacks綜合列表:

復制代碼代碼如下:
/***** Selector Hacks ******/
/* IE6 and below */
* html #uno { color: red }
/* IE7 */
*:first-child+html #dos { color: red }
/* IE7, FF, Saf, Opera */
html>body #tres { color: red }
/* IE8, FF, Saf, Opera (Everything but IE 6,7) */
html>/**/body #cuatro { color: red }
/* Opera 9.27 and below, safari 2 */
html:first-child #cinco { color: red }
/* Safari 2-3 */
html[xmlns*=””] body:last-child #seis { color: red }
/* safari 3+, chrome 1+, opera9+, ff 3.5+ */
body:nth-of-type(1) #siete { color: red }
/* safari 3+, chrome 1+, opera9+, ff 3.5+ */
body:first-of-type #ocho { color: red }
/* saf3+, chrome1+ */
@media screen and (-webkit-min-device-pixel-ratio:0) {
#diez { color: red }
}
/* iPhone / mobile webkit */
@media screen and (max-device-width: 480px) {
#veintiseis { color: red }
}
/* Safari 2 – 3.1 */
html[xmlns*=””]:root #trece { color: red }
/* Safari 2 – 3.1, Opera 9.25 */
*|html[xmlns*=””] #catorce { color: red }
/* Everything but IE6-8 */
root *> #quince { color: red }
/* IE7 */
*+html #dieciocho { color: red }
/* IE 10+ */
@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {
#veintiun { color: red; }
}
/* Firefox only. 1+ */
#veinticuatro, x:-moz-any-link { color: red }
/* Firefox 3.0+ */
#veinticinco, x:-moz-any-link, x:default { color: red }
/* FF 3.5+ */
body:not(:-moz-handler-blocked) #cuarenta { color: red; }
/***** Attribute Hacks ******/
/* IE6 */
#once { _color: blue }
/* IE6, IE7 */
#doce { *color: blue; /* or #color: blue */ }
/* Everything but IE6 */
#diecisiete { color/**/: blue }
/* IE6, IE7, IE8, but also IE9 in some cases */
#diecinueve { color: blue/9; }
/* IE7, IE8 */
#veinte { color/*/**/: blue/9; }
/* IE6, IE7 — acts as an !important */
#veintesiete { color: blue !ie; } /* string after ! can be anything */
/* IE8, IE9 */
#anotherone {color: blue/0/;} /* must go at the END of all rules */
/* IE9, IE10 */
@media screen and (min-width:0/0) {
#veintidos { color: red}
}

1.條件樣式表

像這樣的代碼你應該見過:

復制代碼代碼如下:
<link rel=”stylesheet” type=”text/css” href=”css/style.css” />
<!–[if IE]>
<link rel=”stylesheet” type=”text/css”href=”css/ie.css” />

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 邯郸市| 龙江县| 磐安县| 仙桃市| 台南县| 运城市| 河西区| 龙南县| 青州市| 三台县| 日喀则市| 清苑县| 郯城县| 汶上县| 七台河市| 阿鲁科尔沁旗| 襄樊市| 西乌珠穆沁旗| 沙河市| 阳朔县| 九台市| 衡东县| 简阳市| 清苑县| 富裕县| 万安县| 西峡县| 隆安县| 扶沟县| 闵行区| 苍溪县| 常山县| 绥滨县| 叙永县| 长汀县| 师宗县| 鹿泉市| 荥阳市| 常宁市| 晋江市| 离岛区|