国产探花免费观看_亚洲丰满少妇自慰呻吟_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” />

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 宝鸡市| 扬州市| 双辽市| 融水| 铜梁县| 辽阳县| 屏南县| 玉环县| 思茅市| 芜湖市| 黄山市| 安泽县| 广昌县| 海宁市| 衢州市| 宜丰县| 乌拉特中旗| 衡东县| 灯塔市| 来宾市| 苏尼特右旗| 前郭尔| 漯河市| 尼勒克县| 林芝县| 台南市| 河西区| 郎溪县| 临城县| 溧水县| 颍上县| 鄯善县| 阿克陶县| 秦安县| 弥勒县| 五台县| 沙坪坝区| 稷山县| 黄浦区| 宜城市| 彰化县|