茄子在线看片免费人成视频,午夜福利精品a在线观看,国产高清自产拍在线观看,久久综合久久狠狠综合

    <s id="ddbnn"></s>
  • <sub id="ddbnn"><ol id="ddbnn"></ol></sub>

  • <legend id="ddbnn"></legend><s id="ddbnn"></s>

    css兼容性問題 &amp;&amp; css hack
    來源:易賢網(wǎng) 閱讀:1194 次 日期:2016-06-27 08:44:08
    溫馨提示:易賢網(wǎng)小編為您整理了“css兼容性問題 &amp;&amp; css hack”,方便廣大網(wǎng)友查閱!

    以前做網(wǎng)頁的時(shí)候,只考慮 ie6 和 ff 的兼容性,公司換了,要求也高了,ff和ie 6 7 8 要全兼容了,

    碰到要單獨(dú)hack ie8的。當(dāng)然,用注釋非常方便,只要添加相應(yīng)的注釋就可以解決。但問題是,為了一句css寫多一個(gè)文件,或者在header上添加注釋,那顯然不是懶人的習(xí)慣做法。結(jié)論如下:

    selector{

    property:value; /* 所有瀏覽器 */

    property:value9; /* 所有ie瀏覽器 */

    +property:value; /* ie7 */

    _property

    當(dāng)然,注意順序。根據(jù)css的優(yōu)先性,上面的寫法,分別針對firefox、ie8、ie7和ie6顯示值。讓我們看看這個(gè):

    css代碼如下:

    代碼如下:

    p.ie{

    height:60px;text-align:center;line-height:60px;border:1px dashed #bbb;background:#f7f7f7;font:15;

    color:blue; // 所有瀏覽器

    color:brown9; // 所有ie瀏覽器

    +color:red; // ie7

    _color:green; // ie6

    }

    html 代碼:

    代碼如下:

    <body style=width:500px;margin:0 auto;>

    <p class=ie>

    <span style=display:block;display:none9;>嘿嘿,小子竟然也用firefox,藍(lán)色文字。</span>

    <!--[if ie 8]>不錯(cuò)不錯(cuò),挺先進(jìn)的嘛,使用ie8呢!文字是褐色的。<![endif]-->

    <!--[if ie 7]>你,ie7,紅色文字!<![endif]-->

    <!--[if ie 6]>孩子,雖然顯示的是綠色文字,不過,ie6可不是好東西呢!<![endif]-->

    </p>

    </body>

    注意下面介紹的這些hack寫法僅適用于xhtml1.0。如果沒有在html最前加上

    <!doctype html public -//w3c//dtd xhtml 1.0 transitional//en xmlns=>

    那么效果將不一樣!此外,這里所說的ie8,不是指ie8的兼容模式,因?yàn)閕e8的兼容模式其實(shí)就是ie7。

    區(qū)別ie6、7與ff/ie8:

    background:blue;*background:orange;

    引用

    顯示效果:

    ie 6/7:orange

    ff/ie8:blue

    原理:ff/ie8不支持*開頭,而ie6/7都支持。

    區(qū)別ie6與ie7/ie8/ff:

    background:green;_background:blue;

    引用

    顯示效果:

    ie7/8/ff:green

    ie6:blue

    原理:ie6支持下劃線_,ie7、8和firefox均不支持下劃線。

    區(qū)別ff/ie8和ie6/7:

    background:orange;+background:green;-background:blue;

    或者

    background:orange;*background:green!important;*background:blue;

    引用

    顯示效果:

    ie6:blue

    ie7:green

    ff/ie8:orange

    原理:ie6能識別-,ie7能識別+,ie8和ff都不能識別+和-

    ie8/ff都不識別*,ie7優(yōu)先識別!important,ie6不能識別!important。

    關(guān)于ie8的hacks:

    .test{

    color:/***/#00f9; /* ie8 only */

    color:#00f9; /* 適用于所有ie版本 */

    }

    可同時(shí)區(qū)分ie8、ie7、ie6、firefox的css hacks:

    .test{

    color:#000; /* firefox */

    color:/***/#00f9; /* ie8 */

    *color:#f00; /* ie7 */

    _color:#0f0; /* ie6 */

    }

    添加相應(yīng)的注釋解決兼容性問題

    注釋相應(yīng)的css文件:

    <link rel=stylesheet type=text/css href=css/style.css media=screen />

    <!--[if ie 6]>

    <link rel=stylesheet type=text/css href=css/ie6style.css media=screen />

    <![endif]-->

    <!--[if ie 7]>

    <link rel=stylesheet type=text/css href=css/ie7style.css media=screen />

    <![endif]-->

    <!--[if gte ie 8]>

    <link rel=stylesheet type=text/css href=css/ie8style.css media=screen />

    <![endif]-->

    注釋相應(yīng)的css 內(nèi)容:

    <!--[if ie 6]>

    <style>

    <!--

    #warp{ padding-bottom:11px;}

    -->

    </style>

    <![endif]-->

    <!--[if ie 7]>

    <style>

    <!--

    #warp{ padding-bottom:11px;}

    -->

    </style>

    <![endif]-->

    <!--[if ie 8]>

    <style>

    <!--

    #warp{ padding-bottom:11px;}

    -->

    </style>

    <![endif]-->

    更多信息請查看網(wǎng)頁制作
    上一篇:css的鏈接美化
    易賢網(wǎng)手機(jī)網(wǎng)站地址:css兼容性問題 &amp;&amp; css hack
    由于各方面情況的不斷調(diào)整與變化,易賢網(wǎng)提供的所有考試信息和咨詢回復(fù)僅供參考,敬請考生以權(quán)威部門公布的正式信息和咨詢?yōu)闇?zhǔn)!

    2026國考·省考課程試聽報(bào)名

    • 報(bào)班類型
    • 姓名
    • 手機(jī)號
    • 驗(yàn)證碼
    關(guān)于我們 | 聯(lián)系我們 | 人才招聘 | 網(wǎng)站聲明 | 網(wǎng)站幫助 | 非正式的簡要咨詢 | 簡要咨詢須知 | 新媒體/短視頻平臺 | 手機(jī)站點(diǎn) | 投訴建議
    工業(yè)和信息化部備案號:滇ICP備2023014141號-1 云南省教育廳備案號:云教ICP備0901021 滇公網(wǎng)安備53010202001879號 人力資源服務(wù)許可證:(云)人服證字(2023)第0102001523號
    云南網(wǎng)警備案專用圖標(biāo)
    聯(lián)系電話:0871-65099533/13759567129 獲取招聘考試信息及咨詢關(guān)注公眾號:hfpxwx
    咨詢QQ:1093837350(9:00—18:00)版權(quán)所有:易賢網(wǎng)
    云南網(wǎng)警報(bào)警專用圖標(biāo)