質問

ヘッダ、フッタ、sidebarsて固定位置にします。中心コンテンツ領域の両方のスクロールキャンペーンを行ってきました。ない外側のスクロールバーのブランド、、、。いレイアウトを作ることIE7、FF.私は追加する必要がありIE6です。どうしたいのです。

ここで近似し、近似した現在のCSS.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>

<head>
  <title>Layout</title>
  <style>
    * {
      margin: 0px;
      padding: 0px;
      border: 0px;
    }

    .sample-border {
      border: 1px solid black;
    }

    #header {
      position: absolute;
      top: 0px;
      left: 0px;
      right: 0px;
      height: 60px;
    }

    #left-sidebar {
      position: absolute;
      top: 65px;
      left: 0px;
      width: 220px;
      bottom: 110px;
    }

    #right-sidebar {
      position: absolute;
      top: 65px;
      right: 0px;
      width: 200px;
      bottom: 110px;
    }

    #footer {
      position: absolute;
      bottom: 0px;
      left: 0px;
      right: 0px;
      height: 105px;
    }

    @media screen {
      #content {
        position: absolute;
        top: 65px;
        left: 225px;
        bottom: 110px;
        right: 205px;
        overflow: auto;
      }
      body #left-sidebar,
      body #right-sidebar,
      body #header,
      body #footer,
      body #content {
        position: fixed;
      }
    }
  </style>
</head>

<body>
  <div id="header" class="sample-border"></div>
  <div id="left-sidebar" class="sample-border"></div>
  <div id="right-sidebar" class="sample-border"></div>
  <div id="content" class="sample-border"><img src="/broken.gif" style="display: block; width: 3000px; height: 3000px;" /></div>
  <div id="footer" class="sample-border"></div>
</body>

</html>
役に立ちましたか?

解決

が失わせないアイテムのためのプロジェクトが 研究科長エドワーズ'IE7javascriptをサポート固定の位置決めができるIE6.

他のヒント

下記コードを追加しますの <head>

<!--[if lte IE 6]>
<style type="text/css">
html, body {
    height: 100%;
    overflow: auto;
}
.ie6fixed {
    position: absolute;
}
</style>
<![endif]-->

追加の ie6fixed CSSのクラスにいる position: fixed;

試IE7.js.るべきか固定に問題なくすることはできません。

リンク: IE7.js

これらの回答が最高の立地とアメニティーのとってどのように追加限定形固定位置決めIE6しかし、これらの不具合を修正しました折り、私のレイアウトIE6れば両方を指定し、トップ下cssプロパティマsidebarsの行動が必要).

以降、上下を指定できません使ってトップと高さです。のheightプロパティのみならず、必要です。使用したwebブラウザでjavascriptの実行を再計算の高さがページを負荷したときや、サイズ変更.

以下のコードを加え試験の場合に得られます。これもクリーナーとjQuery.

<!--[if lt IE 7]>
<style>
body>div.ie6-autoheight {
  height: 455px;
}
body>div.ie6-autowidth {
  right: ;
  width: 530px;
}
</style>
<script src="http://ie7-js.googlecode.com/svn/version/2.0(beta3)/IE7.js" type="text/javascript"></script>
<script type="text/javascript">

function fixLayout() {
   if (document.documentElement.offsetWidth) {
      var w = document.documentElement.offsetWidth - 450;
      var h = document.documentElement.offsetHeight - 175;
      var l = document.getElementById('left-sidebar');
      var r = document.getElementById('right-sidebar');
      var c = document.getElementById('content');

      c.style.width = w;
      c.style.height = h;
      l.style.height = h;
      r.style.height = h;
   }
}
window.onresize = fixLayout;
fixLayout();
</script>
<![endif]-->

チェックの純粋なcss hacks下...を必要とするな強制力での操作モードというのがすべての作品も本当:

http://ryanfait.com/resources/fixed-positioning-in-internet-explorer/ http://tagsoup.com/cookbook/css/fixed/

に使用しましたことに大きな効果希望です!

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top