溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊(cè)×
其他方式登錄
點(diǎn)擊 登錄注冊(cè) 即表示同意《億速云用戶服務(wù)條款》

bootstrap和IE8兼容性處理的示例分析

發(fā)布時(shí)間:2021-07-07 11:09:25 來(lái)源:億速云 閱讀:150 作者:小新 欄目:web開(kāi)發(fā)

這篇文章主要介紹了bootstrap和IE8兼容性處理的示例分析,具有一定借鑒價(jià)值,感興趣的朋友可以參考下,希望大家閱讀完這篇文章之后大有收獲,下面讓小編帶著大家一起了解一下。

bootstrap IE8 兼容性處理

<!DOCTYPE html>
<html lang="zh-CN">

  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Bootstrap IE8兼容性</title>
    <link href="css/bootstrap.min.css" rel="external nofollow" rel="stylesheet">
    <link rel="stylesheet" type="text/css" href="css/font-awesome.min.css" rel="external nofollow" />
    
    <!--[if lt IE 9]>
       <script src="//cdn.bootcss.com/html5shiv/3.7.2/html5shiv.min.js"></script>
       <script src="//cdn.bootcss.com/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
    
  </head>

  <body>
    <div class="container">
      <div class="row">
        <div class="col-sm-6" >
          左側(cè)
        </div>
        <div class="col-sm-6" >
          右側(cè)
        </div>
      </div>
    </div>
  </body>

</html>

針對(duì) IE8 仍然需要額外引入 Respond.js 文件以支持媒體查詢(media query)。

1、http協(xié)議下效果(如:http://192.168.12.40:8020/bootstrap/index.html):

bootstrap和IE8兼容性處理的示例分析

2、file文件協(xié)議IE8下效果(如:C:\Users\dell\Documents\HBuilderProject\bootstrap\index.html)

bootstrap和IE8兼容性處理的示例分析

如上圖所示,已經(jīng)不支持柵格布局。

主要存在的問(wèn)題是:

Respond.js 與 file:// 協(xié)議

由于瀏覽器的安全機(jī)制,Respond.js 不能在通過(guò) file:// 協(xié)議(打開(kāi)本地HTML文件所用的協(xié)議)訪問(wèn)的頁(yè)面上發(fā)揮正常的功能。如果需要測(cè)試 IE8 下面的響應(yīng)式特性,務(wù)必通過(guò) http 協(xié)議訪問(wèn)頁(yè)面(例如搭建 apache、nginx 等)。

感謝你能夠認(rèn)真閱讀完這篇文章,希望小編分享的“bootstrap和IE8兼容性處理的示例分析”這篇文章對(duì)大家有幫助,同時(shí)也希望大家多多支持億速云,關(guān)注億速云行業(yè)資訊頻道,更多相關(guān)知識(shí)等著你來(lái)學(xué)習(xí)!

向AI問(wèn)一下細(xì)節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI