私は3つの縦のDIVを並べて2つの列を配置しようとしています。左側の列はメインのテキスト領域で、右側の列はその他の情報用です。 各列の上部と下部のDIVは角が丸いイメージに過ぎません。中央のDIVはテキストのためのものです。さらに、理想的には、各列の中央のDIVがテキストの内容に比例して自動的に垂直方向に拡張されるようにします。続きそれぞれ3つのDIVの2つの列
は私のCSSです:
.main_bkgd_tp_img {
background: url(../images/text.main.tp.gif);
float:left;
width: 400px;
height: 20px;
}
.main_bkgd_btm_img {
background: url(../images/text.main.btm.gif);
float:left;
width: 400px;
height: 20px;
}
.mainbody {
background: url(../images/text.main.fill.gif);
position:relative;
float:left;
width: 400px;
height: 300px;
}
.mainbody .text {
position:absolute;
top:10px;
left:20px;
width:95%;
}
.mainbody p {
position:relative;
font:normal 12px verdana, arial, helvetica, sans-serif;
color:#000;
line-height:15px;
}
.mainbody h1, h2 {
position:relative;
color:#000;
line-height:15px;
}
.rtcol_bkgd_tp_img {
background: url(../images/rtcol.main.tp.gif);
float:right;
width: 100px;
height: 20px;
}
.rtcol_bkgd_btm_img {
background: url(../images/rtcol.main.btm.gif);
float:right;
width: 100px;
height: 20px;
}
.rtcolbody {
background: url(../images/rtcol.main.fill.gif);
position:relative;
float:right;
width: 100px;
height: 300px;
}
.rtcolbody .text {
position:absolute;
top:10px;
right:20px;
width:95%;
}
.rtcolbody p {
position:relative;
font:normal 12px verdana, arial, helvetica, sans-serif;
color:#000;
line-height:15px;
}
.rtcolbody h1, h2 {
position:relative;
color:#000;
line-height:15px;
}
そして、次は私のHTMLです:
<div class="main_bkgd_tp_img"></div>
<div class="mainbody">
<div class="text">
<h4> This is made up text just for testing purposes. The real text will be added later.</h4>
<h4> This is more made up text just for testing purposes. The real text will be added later. </h4>
</div>
</div>
<div class="main_bkgd_btm_img"></div>
<div class="rtcol_bkgd_tp_img"></div>
<div class="rtcolbody">
<div class="text">
<h4> This is a test. </h4> <br/>
<h4>This text is just for testing purposes. The real text will be added later. </h4>
</div>
</div>
<div class="rtcol_bkgd_btm_img"></div>
プロセスにおける実際のページがhereを見ることができます。
ありがとうございました!
私はこれを考え出したと信じています。 "rtcol _...." CSSエントリのそれぞれについて、 "float:right"を "margin-left:420px"に変更しました。
中間のDIVを自動的に。!テキストコンテンツ
おかげ
ようこそStackOverflow!将来の参照のために、4つのスペースでコードをインデントするとPretty-Printになります。 – Dennis
あなたはどんなブラウザをサポートしようとしていますか? CSSだけで丸みのあるコーナーを作成できます。 –