• ベストアンサー

CSSで背景画像をウインドウの中心(横方向)に配置する方法?

過去質問したのですが、解決していないのでまた質問させて頂きます。CSSでウインドウの大きさを変えても指定した背景やコンテンツがずっと中心にいさせる方法はありますか?Yahooのような縦長のページにしたいと思っています。いまの段階は760pxの幅でずっと左側にいるようになっています。中心に移動させたいです。以下に参考のためにソースをのせておきます。 --- css --- h1{ margin-top: 0px; margin-bottom: 10px; text-align:center; } p{ text-align:center; margin-top: 0px; margin-bottom: 10px; } body{ margin-top: 0px; } #maincontents{ width:70%; background-image:url(../img/sakanay.jpg); background-position: center; margin-right: auto; margin-left: auto; } --- html --- <body> <div id="maincontents"> <p align="left"><font size="-3">Team X</font></p><br> <h1><img src="img/ten02.jpg"></h1> <p><img src="img/2005g.jpg"></p> <hr> <a>Copyright(c)2006 TX All rights reserved.</a> <p>&nbsp;</p> <br> </div> </body>

  • HTML
  • 回答数7
  • ありがとう数5

質問者が選んだベストアンサー

  • ベストアンサー
  • chrow
  • ベストアンサー率37% (11/29)
回答No.4

わたしがよく使う方法は、 body { text-align: center; } #maincontents { width: 760px; margin: 0px auto; text-align: left; } とするやり方です。 この方法だと、確実に横幅760pxを確保できるので、ウィンドウ幅を変更されたときにレイアウトが崩れるのを防ぐことができるし、ウィンドウ幅が760px以上の時はコンテンツが真ん中に表示されるようになります。 一応、NNとIEの両方で確認しています。

shige077
質問者

お礼

これまたシンプルプログラムですね。 同じことをするにも色々な方法ができるのですね。 とても参考になりました。 ありがとうございます。

その他の回答 (6)

  • suzuko
  • ベストアンサー率38% (1112/2922)
回答No.7

#2です。 >何に対してのパーセンテージか分かりますか? ブラウザ画面の横幅に対してなのでしょうか。 あ、そうですね。#leftと#contentsはブラウザ画面の横幅に対しの%ですが、#rightと#maincontentsは#contentsに対しての%でしたね。数字、間違えていました。ごめんなさい。 #maincontents{ width:70%; : : } ではなくて #maincontents{ width:82.35%; : : } だったら、ほぼプラウザ画面の70%幅になります。 ただ、前にも書いたようにflaot要素はIEのバージョンによっては表示がおかしくなります。#4#6の方が勧める方法が一般的ですよね。^^;

shige077
質問者

お礼

再度質問に答えていただき、有難うございます。 ブラウザ画面の横幅に対しの%だったのですね。

  • partita
  • ベストアンサー率29% (125/427)
回答No.6

しょうがないから昔ながらのテーブルレイアウト。 <!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=euc-jp"> <title>タイトル</title> <style> body {width:100%;height:100%;vertical-align:middle;margin:0;padding:0;} table {width:100%;height:100%;vertical-align:middle;margin:0;padding:0;} div {width:300px; background-color:#00FF33;margin:auto;} </style> </head> <body> <table> <tr> <td><div><img src="_img/index/i_center_photo04.gif">いろいろ</div></td> </tr> </table> </body> </html>

shige077
質問者

補足

ご回答ありがとうございます。 しかし、HTML4.01ではレイアウトにTableタグを使わないように推奨されていると聞いたことがあるのですが、その点はいかがでしょうか?

noname#19206
noname#19206
回答No.5

画像やテキストなどを個別にセンタリングしたい場合は text-align:center; で OK です。 …が、ボックスなどをセンタリングしたい場合はちょっとした工夫が必要です。 http://www.mozilla.gr.jp/standards/webtips0004.html ぶっちゃけ IE に対応させれば大抵の人間が見られるって言うのは事実だと思いますが、 それだと当然非 IE だとか Macintosh だとかのユーザーがいた場合に苦情が来るんですよね。 最悪の場合黙ってそのサイトを去っていくこともあるし…。 やっぱりブラウザ間での互換性には十分配慮しなければいけません。

shige077
質問者

お礼

この点考慮していかないとますですよね。 ご指摘有難うございました。

  • crepon133
  • ベストアンサー率51% (399/776)
回答No.3

#maincontentsをセンターに配置する #page { text-align:center; margin: 0px; padding: 0px; } <div id="page"> <div id="maincontents">  ・  ・ </div> </div> <p align="left">これはクラス指定にした方が・・・

shige077
質問者

お礼

非常に簡単にできました。ありがとうございます。とってもシンプルにかけていて満足です。

  • suzuko
  • ベストアンサー率38% (1112/2922)
回答No.2

絶対配置の場合、対応プラウザによる違いが出ます。 比較的マシなのは、3段組にして左右に空のスペースを置くことでしょうか。 ただ下のfloatの配置方法だと、IEで適用されないらしいのですが・・未検証です。^^; ********CSS**************** #left{ width:15%; float:left; } #contents{ width:85%; float:right; } #right{ width:15%; float:right; } #maincontents{ width:70%; float:left; background-image:url(../img/sakanay.jpg); } #foot{ clear:both; } *********html********* <body> <div id="left"></div> <div id="contents"> <div id="maincontents"> </div> <div id="right"></div> </div> <div id="foot"></div> </body> 配置の方法はこれ以外にも色々ありますよ~

shige077
質問者

補足

ご回答ありがとうございます。 width:15% width:85% などの”%”ですが、 何に対してのパーセンテージか分かりますか? ブラウザ画面の横幅に対してなのでしょうか。

  • Bit0029
  • ベストアンサー率0% (0/2)
回答No.1

また回答練習(?)しますね。 背景画像を中心に配置したいのですよね。 上記ソース同じく作成しました。 background-position: center;で背景画像を中央に配置できますね。 また垂直もなら、background-position: center center; firefoxやIE6.0じゃなくて古いブラウザ対応の事でしょうか? #maincontents{ width:70%; background-image:url(image/php.jpg); background-position: center; margin-right: auto; margin-left: auto; background-repeat: no-repeat; } あんり役に立たない回答だったかな・・・( ̄_ ̄;)

参考URL:
http://www.stylish-style.com/csstec/csstec-top.html
shige077
質問者

お礼

アドバイスありがとうございました。このソースで試してみましたがだめでした。

関連するQ&A

  • フッターの画像の位置づけ指定方法がわからない

    ヘッダー・メイン・サイドバー(左右)・フッターの5コマ組みのサイトを表現したいのですが、 フッターに指定した画像を全体サイズでセンターに寄せて(画像の上に、真ん中寄せでテキストを乗せたい)反映させるにはどうしたらいいのでしょうか。フッターに指定しているjpg画像のサイズは、(○●.jpg);511×229pxです、よろしくお願いします。 <style type="text/css"> body /* コンテナ */ div#container{width: 100%; margin-left: auto; margin-right: auto} /* ヘッダー */ div#header{background-color: #ffffff;             font-color:#4876ff; /*background-image: url(.jpg);*/ background-repeat: no-repeat; background-position: center top;          /*padding: 28px 20px 150px*/ } div#header h1{margin: 0} div#header p{color: #ffffff; font-size: 0.50em; margin: 0} /* メイン */ div#main{width: 100%; float: left; margin-right: -230px} /* コンテンツ */ div#content{width: 100%; float: right; margin-left: -186px; margin-right: auto; margin-bottom: 25px} div#content h2, div#content h3, div#content p {margin-left: 186px; margin-right: 230px} div#content h2{background-color: #92c9ff; background-image: url(); background-repeat: repeat-x; border: solid 1px #84c2ff; font-size: 0.875em; color: #00688b; line-height: 32px; padding-left: 6px; margin-top: 0; margin-bottom: 0} div#content h3{background-color: #ffffff; background-image: url(); background-repeat: no-repeat; background-position: 0px 2px; font-size: 0.875em; line-height: 22px; padding-left: 26px; margin-top: 30px; margin-bottom: 0} div#content p{font-size: 0.75em; line-height: 1.6; margin-top: 10px} /* サイドバー */ div#sidebar{ background-image:url(.jpg); width: 170px; float: left; margin-bottom: 25px} ul.sidemenu{font-size: 0.90em; margin-top: 0; margin-left: 0; padding-left: 0; line-height: 0} ul.sidemenu li{list-style-type: none} ul.sidemenu li a{       display: block; line-height: 25px; text-decoration: none;    text-align:right background-img:url(.gif);       padding-left: 10px} ul.sidemenu li a:hover{background-color: #cdc1c5               color: #8b1c62 } ul.sidemenu ul {margin: 0;       padding: 0} ul.sidemenu ul li a {background-img:url(gif); color:#5d478b; border-bottom: solid 1px #ab82ff;        line-height: 24px} ul.sidemenu ul li a:hover {background-color: #eee0e5;                   color:#ffffff;      border-bottom: solid 1px #ab82ff; } p.feed{margin-bottom: 10px} p.feed a{font-size: 0.75em; color: #444444; text-decoration: none; line-height: 30px; border: solid 1px #888888; padding: 5px} p.feed img{border: none; vertical-align: middle} /* 右サイドバー */ div#sidebar-right{width: 150px; float: right} div.info{border: solid 1px #84c2ff; margin-bottom: 18px} div#sidebar-right h2{background-color: #c6e3ff;   background-image: url(); color: #3c5916; font-size: 0.75em; text-align: center; padding: 5px; margin-top: 0; margin-bottom: 3px} div#sidebar-right p.photo{text-align: center} div#sidebar-right p{font-size: 0.75em; margin: 10px 5px} div#sidebar-right ul{font-size: 0.75em; margin: 5px; padding: 0} div#sidebar-right ul li {background-image: url(); background-repeat: no-repeat; background-position: 0 6px; padding-left: 13px; list-style-type: none} /* フッター */ div#footer{background-image:url(○●.jpg);       background-repeat: no-repeat; width: 100%; margin-top: ; padding-top: 8px; clear: both} address{font-size: 0.75em; font-style: normal; text-align: center} </style> ・・・・・・・・ここまで指定 ここから、html打ち込み↓ <!-- フッター --> <div id="footer"align="center"> ~~テキスト文章~~<br> <address><big>~アドレスのテキスト~</address></big> <br>○○おなじくテキスト</div> <div align="center"> ~◆◆サイトの名前~   <img src="○○.jpg"border="0"bordercolor="#87ceeb"alt=""> <br><br> </body> </html> 少しいじると、おかしな反映になります、お助け下さい。

    • 締切済み
    • CSS
  • CSSで3分割した背景画像を配置したいけど隙間が出来てしまう?

    初めて質問させていただきます。 当方はCSS初心者です。 画像(グラデーションのある角丸四角枠)を3分割し、それを背景画像として配置したいのですが、WinIE6などで表示するとどうしても画像に隙間ができてしまうのです。 IE7、FireFoxでは無事に希望通りに表示されています。 【HTML】 <div id="wrapper"> <div class="top"></div> <div class="middle"></div> <div class="bottom"></div> </div> 【CSS】 #wrapper{ width:680px; height:auto; border:0 auto; padding:0; } .top{ width:650px; height:10px; background-image:url(img/01.gif); background-position:top center; background-repeat:no-repeat; margin:0 auto; padding:0; } .middle{ width:650px; background-image:url(img/02.gif); background-repeat:repeat-y; margin:0 auto; padding:0; } .bottom{ width:650px; height:13px; background-image:url(img/03.gif); background-repeat:no-repeat; background-position:bottom center; margin:0 auto; padding:0px; } といった感じで、ざくっとwrapperの中に背景画像をセンターで敷きたいのです。 .topと.middleの間には隙間は出来ないのですが、.middleと.bottomの間に数pxの隙間が出来てしまうのです。 制作環境はDreamweaver8、MAC/OSXですが、動作確認はWin/XPでも行っています。 何卒ご教示下さい。

  • 背景画像をCSSで中央に指定し、さらにその背景画像の中に違う画像を

    背景画像をCSSで中央に指定し、さらにその背景画像の中に違う画像を 位置指定したいのですが、うまく反映されませんでした。 「 background-position: center center; 」「 background-position: center center; 」 がCSS側での背景画像位置指定と多くヒットしたのですが、反映はされませんでした。 「 margin-left: 80px; 」を指定したところ、画面中央に位置が反映されたのですが 画面サイズを1024×768から1280×1024に変更すると 中央から左寄りにずれてしまいます。 下記に実際のソースを記載致しますので、どなたか解る方がいらっしゃいましたら アドバイスの程宜しくお願いいたします。 - 画面サイズを変更すると位置がずれてしまうソース - @charset "utf-8"; #img { width: 700px; height: 125px; background: url(img.jpg); margin-left: 80px; background-repeat: no-repeat; } #img #img2 { float: right; margin-right: 0px; margin-left: 30px; margin-top: 59px; margin-bottom: 0px; } ---------------------------------- - HTML - <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Style-Type" content="text/css" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>img</title> <link rel="stylesheet" href="style.css" type="text/css" /> </head> <body"> <div id="img"> <div id="img2"><img src="img_1.gif" width="50" height="30" border="0" />&nbsp;<img src="img_2.gif" width="50" height="30" border="0" /></div> </div> </body> </html> ------------------------------------------- - 検索でヒットした位置指定のソース - @charset "utf-8"; #img { width: 700px; height: 125px; background: url(img_2.jpg); background-position: center center; background-repeat: no-repeat; } #img #img2 { float: right; margin-right: 0px; margin-left: 30px; margin-top: 59px; margin-bottom: 0px; } ------------------------------------------- - HTMLは上記と同じ -

    • ベストアンサー
    • HTML
  • cssによる配置の計算が合いません

    cssによる配置で width の計算がうまくあいません。 コンテンツ部分が 750(ページ)-5(padding)-1(border)-134(navi-width)-5(padding)-1(border)=604(contents-border) ちなみにSafariでは計算通りでした。 IE6ではだめなようです。 くわしくは <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=Shift_JIS"> <meta http-equiv="Content-Style-Type" content="text/css"> <style type="text/css"> BODY { padding-top : 0px; margin-top : 0px; text-align : center; padding-bottom : 0px; margin-bottom : 0px; } #page { background-color : #dd22aa; width : 750px; margin : 0; padding-top : 0px; text-align : left; margin-top : 0px; margin-left : auto; margin-right : auto; margin-bottom : 0px; height: 100%; padding : 0px ; } #header { width : 750px; height : 80px; position : relative; float:left; clear : both; background-color : #008899; padding: 0px; margin: 0px; color : #b99859; } #navi { width : 134px; height : 399px; float : left; position : relative; clear : both; background-color : #ffffff; background-repeat : no-repeat;background-position : center top; padding-top : 50px; padding-left : 0px; padding-right : 0px; padding-bottom : 0px; margin-top : 0px; margin-left : 5px; margin-right : 0px; margin-bottom : 0px; border-left-style : solid; border-left-width : 1px; border-left-color : #000000; } #contents { width :596px; height : 399px; float : right; position : relative; padding : 0px; margin-top : 0px; margin-left : 0px; margin-right : 5px; margin-bottom : 0px; background-color: #9999FF; border-right-style : solid; border-right-width : 1px; border-right-color : #000000; } </style> <title>テスト</title> </head> <body> <div id="page"> <div id="header"> ヘッダー </div> <div id="navi"> ナビゲーション。左のパディングが5px。左のボダーが1px。幅が134px。 </div> <div id="contents"> コンテンツ。右のパディングが5px。右のボダーが1px。幅が596px。計算すると、750-5-1-134-5-1=604(幅)となるはずなのですが、596pxでないとはまりません。 </div> </div> </body> </html>

  • CSSで画像配置の垂直方向指定

    画像をいくつも展示するページを製作しているのですが、画像の垂直方向指定がうまくいきません。 縦長の画像と、横長の画像(サイズは同じ)を二枚横に並べたときに添付画像の下の方のように表示させたいのです。 タグはそれぞれしたのようなかんじです。 *****************CSS***************** #photo { margin:0 0 0 30px; padding:0; background: transparent; text-align:center; font-size : 1em; color:#69788A; } .image { font-size : 0.9em; margin : 0; padding : 10px 0 10px 0; float:center; width : 800px; border-bottom:2px solid #CFDEEF; } .left-img { float: left; width : 50%; } .right-img { float: right; width : 50%; } *****************HTML***************** <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta NAME="ROBOTS" CONTENT="NOINDEX,NOFOLLOW,NOARCHIVE"> <meta http-equiv="Content-Type" content="text/html; charset=shift_jis"> <meta http-equiv="Content-Style-Type" content="text/css"> <link rel="stylesheet" href="style.css" type="text/css"> <title>***********</title> <style type="text/css"> body { background: transparent; } </style> </head> <body id="photo"> <div class="image"> <p class="left-img"><img src="016.jpg" border="0"></p> <p class="right-img"><img src="017.jpg" border="0"></div> </body> </html> よろしくお願いします。

    • ベストアンサー
    • HTML
  • css 背景画像(1つ)とリンク付き画像(複数)を中心に表示したい。(

    css 背景画像(1つ)とリンク付き画像(複数)を中心に表示したい。(超初心者です。) 現在、Kompozerをつかってホームページを作成しています。 添付画像のような配置にしたいので、いろいろなサイトを参照したのですがどうしてもうまくいきません。 現在のソースは以下のようになっており、ブラウザで表示すると背景画像が表示されません。 あまりにも知識がなく、不快な思いをさせてしまったら申し訳ございません。 ご指導いただければうれしいです。 よろしくお願いします。 *ソース <html><head> <meta content="text/html; charset=Shift_JIS" http-equiv="content-type"> <title>ページタイトル</title> <style type="text/css"> </style> </head><body> <div style="text-align: center;" background-image:="" url **.jpg ;width:450px;height:450px;=""><br> <br> <img style="width: 137px; height: 137px;" alt="" src="**.gif" border="0"><br> <br><p style="text-align: center;"> <a href="**.html"><img style="border: 0px solid ; width: 92px; height: 230px;" alt="" src="**.jpg"></a><a href="**.html"><img style="border: 0px solid ; width: 92px; height: 230px;" alt="" src="**.jpg"></a><img style="width: 92px; height: 230px;" alt="" src="**.jpg"><a href="**.html"><img style="border: 0px solid ; width: 92px; height: 230px;" alt="" src="**.jpg"></a><br></p> </div> </body></html>

    • ベストアンサー
    • HTML
  • CSSでDIVで挟んでいるのに背景色が出ない?

    CSSと(X)HTMLでページを作っています。角丸なページにしたいため、 /* ---------- 角丸画像の上辺 ---------- */ #main_contents_header { width: 800px; height:20px; background:url(./top.png) no-repeat top; margin: 10px auto 0px; padding: 0; text-align: center; } /* ---------- 上辺と下辺の間のメイン部分 ---------- */ #main_contents { background:url(./bg.png); width: 800px; margin: 0 auto; padding: 0; text-align: center; } /* ---------- 角丸画像の下辺 ---------- */ #main_contents_bottom { width: 800px; height:20px; background:url(./bottom.png) no-repeat top; margin: 0 auto; padding: 0; text-align: center; } というCSSを作り、 HTMLは <div id="main_contents_top"></div> <div id="main_contents"> ここにいろいろなコンテンツを置いていく </div> <div id="main_contents_bottom"></div> という書き方にしているのですが、<div id="main_contents">の背景画像が正しく出ず、地の色が見えてしまうのです。試しに<div id="main_contents">へpadding-bottom:300pxというような指定を加えると、正しく背景画像が出ました。 <div id="main_contents"> ここにいろいろなコンテンツを置いていく </div> という書き方ではダメなのでしょうか・・・? 確認はFirefoxとSafariでやっています。

    • ベストアンサー
    • HTML
  • 画像をセンター配置にする方法

    過去ログを検索したのですが、同じような方法が載っていなくて質問させていただきます。 以下の画像にある通り、img_01とimg_02とimg_03を画面中央に配置したいのですがどうしてもうまくいきません。 根本的な部分の理解ができていないかもしれませんが、どうかご教授お願いします。 【HTML】 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>無題</title> <link href="css/common.css" rel="stylesheet" type="text/css" /> </head> <body> <!--▼▼ヘッダーここから▼▼--> <div id="header"> <p>ヘッダー</p> </div> <!--▲▲ヘッダーここまで▲▲--> <!--▼▼メインここから▼▼--> <div id="main"> <ul> <div id="main_site01"> <p class="center">aaa01</p><li><img src="images/site01.jpg" width="300" height="200" alt="01" /></li><p class="center">aaa01</p> </div> <div id="main_site02"> <p class="center">aaa02</p><li><img src="images/site02.jpg" width="300" height="200" alt="02" /></li><p class="center">aaa01</p> </div> <div id="main_site03"> <p class="center">aaa03</p><li><img src="images/site03.jpg" width="300" height="200" alt="03" /></li><p class="center">aaa01</p> </div> </ul> </div> <!--▲▲メインここまで▲▲--> <!--▼▼フッターここから▼▼--> <div id="footer"> <p>フッター</p> </div> <!--▲▲フッターここまで-▲▲--> </body> </html> 【HTMLここまで】 -------------------------------------------------------------------------------- 【CSS】 @charset "utf-8"; /*******************/ /* リセットcss */ /*******************/ * { margin: 0; padding: 0; list-style-type: none; line-height: 1.6; font-family: "メイリオ","MS Pゴシック","ヒラギノ角ゴ Pro W3"; } img { border: none; } /*******************/ /* コンテンツ */ /*******************/ body { background-color: #000; } #header { height: 100px; margin-top: 50px; font-size: 18px; background-color: #fff; } #main { color: #FFF; width: 990px; text-align: center; } #main ul li { float: left; margin: 0 15px 15px; } #main_site01 { float: left; } #main_site02 { float: left; } #main_site03 { float: left; } .center { text-align: center; margin-top: 15px; } #main ul { text-align: center; } #footer { height: 100px; font-size: 18px; color: #000; clear: both; background-color: #fff; } 【CSSここまで】

  • ホームページの背景画像が途切れてしまう。

    こんにちは。 現在、ホームページを作っているのですが、背景画像で困ってしまって質問しました。 ホームページはhtmlとCSSを使って、ホームページビルダーで作っています。 bodyに背景画像1を設定しています。 ホームページの内容は <div></div>の中にinnerというclassを作って スタイルシートで40px×40pxの背景画像2を「repeat」指定しています。 この背景画像2が、IEでは表示されているのですが、firefoxやchromeだと下のほうで 途切れてしまいます。 それも、ちゃんと表示できてるページと、途切れてしまうページの2種類があります。 原因を自分でも探してみたのですが、見つかりませんでした。 もし、知っている、気付いた方がいらっしゃったら教えていただけませんか?? よろしくお願いします。 ちなみに、下記はスタイルシートに記載しているものです。 --------------------------------------------------------------------- body{ text-align:center; margin-right : auto;margin-left : auto; background-image : url(mokuteki/taiiku/bg_brown.png); background-repeat: repeat; font-size : 90%; padding-top : 0px; padding-bottom : 0px; margin-top : 0px; margin-bottom : 0px; } #wrap{ text-align : center; margin-top : 0px; margin-left : auto; margin-right : auto; margin-bottom : auto; width : 100%; padding-top : 0px; } .inner{ text-align : left; margin-top : 0px; margin-left : auto; margin-right : auto; width : 900px; background-image : url(images/bg_white.png); background-repeat : repeat; } -----------------------------------------------------------------

  • CSSで背景画像を一番下にもってきたいのですが・・・

    依頼されたページを作成中ですが、 bodyに指定したbackground画像を一番下にもってくるにはどうしたら良いか分からず、困っております。 #loginの背景に指定した「top_haikei.jpg」は、 position: fixed ; bottom:0; と指定することで一番下にもってくることに成功しましたが、 bodyの背景に指定している「haikei_bottom.gif」を一番下に持ってくる方法が分かりません。 CSS初心者の為、詳細にご教示頂ける方のご回答をお待ちしております! よろしくお願い致しますm(u_u)m ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ■CSS *{ margin:0px; padding:0px; } html { scrollbar-face-color: #F5E1D8; scrollbar-highlight-color: #FFFFFF; scrollbar-shadow-color:#F5E1D8; scrollbar-3dlight-color: #F5E1D8; scrollbar-arrow-color: #FFFFFF; scrollbar-track-color: #FFFFFF; scrollbar-darkshadow-color: #FFFFFF; } body { margin:0 auto 0; background-color: #FFFFFF; font-family:sans-serif; font-size:8pt; background-image: url(../img/haikei_bottom.gif); background-repeat: repeat-x; background-position: center bottom; } form { margin:0px; scrollbar-face-color: #F5E1D8; scrollbar-highlight-color: #FFFFFF; scrollbar-shadow-color:#F5E1D8; scrollbar-3dlight-color: #F5E1D8; scrollbar-arrow-color: #FFFFFF; scrollbar-track-color: #FFFFFF; scrollbar-darkshadow-color: #FFFFFF; } input { font-size:12px; } #container { width:950px; margin:0 auto 0; background-color:#FFFFFF; } #logo{ margin-left:80px; height:180px; } #box1{ text-align:center; line-height:20px; height:150px; } #login{ height:250px; background-image: url(../img/top_haikei.jpg); background-repeat: no-repeat; background-position: center bottom; position: fixed ; bottom:0; } #login_left{ float:left; margin-top:120px; margin-right:50px; line-height:20px; width:700px; } #login_right{ float:left; margin-top:100px; width:200px; }

専門家に質問してみよう