電子書籍の厳選無料作品が豊富!

現在、リキッドデザインで幅3カラムのレイアウトをしようとしています。
左端のみ幅を178pxに固定し、中央と右のブロックはそれぞれ残りの画面を二分割し、最低幅401pxで制作した上に、それぞれのカラムを個別にスクロールさせようと考えています。
以下のコーディングでFirefoxとChrome、Safariでは想定したレイアウトを概ね実現できたのですが(厳密には中央と右のサイズが微妙に異なっていて調整できていません)、IE9以下は全てレイアウトが崩れて表示されてしまいます。
IE6はともかくとしても、IE7以降で崩れずにレイアウトを完成させる方法は無いでしょうか。

さらに欲を言えば中央と右カラムを完全に二分割のサイズにできるとありがたいです。
(こちらはできればで結構ですが。。。)

おわかりいただける方、お知恵をお借りできないでしょうか。
ご迷惑をおかけしますが、よろしくお願いいたします。
------------html------------
<div id="wrap">
<div id="contents">

<div id="wall">

<div id="nav">
左ブロック
</div>

<div id="main">
中央ブロック
</div>

</div>

<div id="sub">
右ブロッック
</div>

</div>
</div>
----------------------------
------------css------------
#wrap{
width:100%;
text-align:left;
min-height: 100%;
font-size: 100%;

}

#contents{
position:fixed;
overflow:auto;
width:100%;
min-width:980px;
height:100%;
margin-top:60px;
}

#wall{
position:fixed;
overflow:auto;
width:60%;
min-width:579px;
height:100%;
}

#nav{
position:fixed;
overflow:auto;
left:0px;
width:178px;
height:100%;
}

#main{
width:100%;
min-width:401px;
height:100%;
margin-left:178px;

}

#sub{
width:40%;
min-width:401px;
height:100%;
margin-left:60%;
}
----------------------------

A 回答 (3件)

左側もスクロールさせるのなら、ずっと簡単に



<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="ja">
<head>
_<meta http-equiv="content-type" content="text/html; charset=Shift_JIS">
_<title>サンプル</title>
_<meta name="author" content="ORUKA1951">
_<meta http-equiv="Content-Style-Type" content="text/css">
_<link rev="made" href="mailto:oruka1951@hoge.com" title="send a mail" >
_<link rel="START" href="../index.html">
_<style type="text/css">
<!--
html,body{background-color:gray;
_margin:0;padding:0;
}
div.article{background-color:green;
_height:400px;margin:0;paddig:0;
_position:relative;
_padding-left:178px;
}
div.main{background-color:yellow;
_height:100%;margin:0;
_position:relative;
}
div.contentTable,div.section,div.aside{overflow:auto;}
div.contentTable,div.aside{
_position:absolute;top:0;
_height:100%;margin:0;
}
div.contentTable{background-color:white;
_width:178px;
_left:0;
}
div.aside{background-color:fuchsia;
_width:50%;right:0;}
div.section{background-color:lime;
_width:50%;height:100%;
}
div.section div.section{width:100%;height:auto;}
-->
_</style>
</head>
<body>
_<div class="header" id="Top">
__<h1>タイトル</h1>
_</div>
_<div class="article">
__<div class="contentTable">
___<ol>
____<li><a href="#Top">トップ</a></li>
____<li><a href="#section1">一章</a></li>
____<li><a href="#section2">ニ章</a></li>
____<li><a href="#section3">三章</a></li>
____<li><a href="#section4">四章</a></li>
____<li><a href="#aside1">補足</a></li>
・・・【中略】・・・
___</ol>
__</div>
__<div class="main">
___<div class="section">
____<div class="section" id="section1">
_____<h2>記事(1)</h2>
_____<p>ここに本文が入る</p>
_____<p>ここに本文が入る</p>
_____<p>ここに本文が入る</p>
____</div>
____<div class="section" id="section2">
_____<h2>記事(2)</h2>
_____<p>ここに本文が入る</p>
_____<p>ここに本文が入る</p>
_____<p>ここに本文が入る</p>
____</div>
____<div class="section" id="section3">
_____<h2>記事(3)</h2>
_____<p>ここに本文が入る</p>
_____<p>ここに本文が入る</p>
_____<p>ここに本文が入る</p>
____</div>
____<div class="section" id="section4">
_____<h2>記事(4)</h2>
_____<p>ここに本文が入る</p>
_____<p>ここに本文が入る</p>
_____<p>ここに本文が入る</p>
_____<p>ここに本文が入る</p>
_____<p>ここに本文が入る</p>
_____<p>ここに本文が入る</p>
_____<p>ここに本文が入る</p>
_____<p>ここに本文が入る</p>
_____<p>ここに本文が入る</p>
____</div>
___</div>
___<div class="aside" id="aside1">
____<h2>補足記事</h2>
____<p>記事</p>
____<p>記事</p>
____<p>記事</p>
____<p>記事</p>
____<p>記事</p>
____<p>記事</p>
____<p>記事</p>
____<p>記事</p>
____<p>記事</p>
____<p>記事</p>
____<p>記事</p>
____<p>記事</p>
___</div>
__</div>
_</div>
_<div class="footer" id="documentInfo">
__<h2>文書情報</h2>
_</div>
</body>
</html>
    • good
    • 0
この回答へのお礼

ありがとうございます!
やりたいことがほぼ実現できたと思います!!
教えていただいたものを元に、ちゃんと動くか組み込んでみます。
どうもありがとうございました!

お礼日時:2011/12/14 00:46

HTMLとCSSはややこしいので見てません。

なぜかはサンプルコードを見ればわかるでしょう。
「左端のみ幅を178pxに固定し、中央と右のブロックはそれぞれ残りの画面を二分割し、最低幅401pxで制作した上に、それぞれのカラムを個別にスクロールさせようと考えています。」
だけから
★Another HTML-lint gateway( http://openlab.ring.gr.jp/k16/htmllint/htmllint. … )
★W3C CSS 検証サービス( http://jigsaw.w3.org/css-validator/#validate_by_ … )
でチェック済み。HTML4.01strict+CSS2
タブは_に置換してあるので戻すこと。

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="ja">
<head>
_<meta http-equiv="content-type" content="text/html; charset=Shift_JIS">
_<title>サンプル</title>
_<meta name="author" content="ORUKA1951">
_<meta http-equiv="Content-Style-Type" content="text/css">
_<link rev="made" href="mailto:oruka1951@hoge.com" title="send a mail" >
_<link rel="START" href="../index.html">
_<style type="text/css">
<!--
html,body{
_margin:0;padding:0;
_background-color:gray;/* for test */
}
div{border:solid 0.1px gray;}
div.section{
_height:400px;margin-left:178px;
_position:relative;
_background-color:green;/* for test */
}
div.section div.section{
_height:100%;width:50%;margin:0;
_overflow:auto;
_position:absolute;/* for IE7 */
_top:0;
_background-color:yellow;/* for test */
}
div.section div.section div.section{
_position:static;/* for IE7 */
_width:100%;
_height:auto;
_overflow:visible;
_background-color:lime;/* for test */
}
div.section div.contentTable{
_position:fixed;
_width:178px;height:400px;
_left:0;
_background-color:white;/* for test */
}
div.section div.aside{
_position:absolute;
_width:50%;margin:0;height:100%;
_overflow:auto;right:0;top:0;
_background-color:fuchsia;/* for test*/
}
-->
_</style>
</head>
<body>
_<div class="header" id="Top">
__<h1>タイトル</h1>
_</div>
_<div class="section">
__<div class="contentTable">
___<ol>
____<li><a href="#Top">トップ</a></li>
____<li><a href="#section1">一章</a></li>
____<li><a href="#section2">ニ章</a></li>
____<li><a href="#section3">三章</a></li>
____<li><a href="#section4">四章</a></li>
____<li><a href="#aside1">補足</a></li>
____<li><a href="#documentInfo">文書情報</a></li>
___</ol>
__</div>
__<div class="section">
___<div class="section" id="section1">
____<h2>記事(1)</h2>
____<p>ここに本文が入る</p>
____<p>ここに本文が入る</p>
____<p>ここに本文が入る</p>
___</div>
___<div class="section" id="section2">
____<h2>記事(2)</h2>
____<p>ここに本文が入る</p>
____<p>ここに本文が入る</p>
____<p>ここに本文が入る</p>
___</div>
___<div class="section" id="section3">
____<h2>記事(3)</h2>
____<p>ここに本文が入る</p>
____<p>ここに本文が入る</p>
____<p>ここに本文が入る</p>
___</div>
___<div class="section" id="section4">
____<h2>記事(4)</h2>
____<p>ここに本文が入る</p>
____<p>ここに本文が入る</p>
____<p>ここに本文が入る</p>
____<p>ここに本文が入る</p>
____<p>ここに本文が入る</p>
____<p>ここに本文が入る</p>
____<p>ここに本文が入る</p>
____<p>ここに本文が入る</p>
____<p>ここに本文が入る</p>
___</div>
__</div>
__<div class="aside" id="aside1">
___<h2>補足記事</h2>
___<p>記事</p>
___<p>記事</p>
___<p>記事</p>
___<p>記事</p>
___<p>記事</p>
___<p>記事</p>
___<p>記事</p>
___<p>記事</p>
___<p>記事</p>
___<p>記事</p>
___<p>記事</p>
___<p>記事</p>
__</div>
_</div>
_<div class="footer" id="documentInfo">
__<h2>文書情報</h2>
_</div>
</body>
</html>
    • good
    • 0
この回答へのお礼

ありがとうございました!
いただいたサンプルを見てみたのですが、左カラムはスクロールしないようでしたので、
もう少しいじれないか試してみます。

やはりposition:fixedを多用すべきでは無いですかね。。。
かなり試行錯誤をして、ご回答のような使わないパターンも考えてみていたのですが、
どうにもうまくいっておらず。。。。

ともかくありがとうございました!

お礼日時:2011/12/12 12:05

多重 DIV構造になってしまいましたが、とりあえず作ってみました。


IE9の表示は未確認です。

(HTML)
<div class="contents">
<div class="nav">左ブロック</div>
<div class="main-sub-w">
<div class="main-sub-in-w">
<div class="main">中央ブロック</div>
<div class="sub-w">
<div class="sub">右ブロッック</div>
</div>
</div>
</div>
</div>

(CSS)
.contents {
height: 300px; /* 適当 */
min-width: 980px; /* 178 + 401 + 401 */
}
.nav {
float: left;
margin-right: -178px;
overflow: auto;
width: 178px;
height: 100%;
background: #fcc;
}
.main-sub-w {
float: left;
width: 100%;
height: 100%;
}
.main-sub-in-w {
margin-left: 178px;
width: auto;
height: 100%;
}
.main {
float: left;
margin-right: -50%;
overflow: auto;
width: 50%;
height: 100%;
background: #cfc;
}
.sub-w {
float: left;
width: 100%;
height: 100%;
}
.sub {
margin-left: 50%;
overflow: auto;
height: 100%;
background: #ccf;
}
    • good
    • 0
この回答へのお礼

ありがとうございます。
内容を確認してみたのですが、左カラムと中央カラムのスクロールバーが表示されてはいるのですが、
どうもうまくスクロールしないようです。
もう少し考えてみますね。

お礼日時:2011/12/14 00:44

お探しのQ&Aが見つからない時は、教えて!gooで質問しましょう!