• ベストアンサー

HTML&CSS DIVをぴったりと縦に並べたい

HTML&CSS初心者です。 下記のソース様に、DIVで一つにまとめたBOXを縦に並べたいのですが、 「見出し002」の上のマージンがうまく取れずに困っています。 .box内のphoto00.jpgをフロートにしている為、フロートが悪さをしている事を考え、 「見出し002」の上のDIV内に<br style="clear: both;" />を入れると、余白が生まれるのですが、 MacのSafariとFirefoxでは、余白の差が出てしまいます。(Safariの方が余白が大きい) <br style="clear: both;" />を入れないと、上のマージンはほぼ消えてしまい、わずかにFirefoxの方では余白が生まれます。 ちなみにこの現象は「ここにテキストが入ります。」の行数を減らすと解決するのですが、 下記のソースでも、photo00.jpgの高さをはみ出す行数ではない為、この<div class="box">に 変な膨らみを持たせたくありません。 どなたか解決法を教えて下さい。よろしくお願い致します。 【HTML】 <div id="main"> <div class="mds01"><h3><em>見出し001</em></h3></div> <div class="box"> <img src="img/photo00.jpg" width="155" height="108"> <h5>小見出し</h5> <p class="txt">ここにテキストが入ります。<br><br> ここにテキストが入ります。<br> ここにテキストが入ります。</p> </div> <div class="box"> <img src="img/photo00.jpg" width="155" height="108"> <h5>小見出し</h5> <p class="txt">ここにテキストが入ります。<br><br> ここにテキストが入ります。<br> ここにテキストが入ります。</p><br style="clear: both;" /> </div> <div class="mds02"><h3><em>見出し002</em></h3></div> <div class="box"> <img src="img/photo00.jpg" width="155" height="108"> <h5>小見出し</h5> <p class="txt">ここにテキストが入ります。<br><br> ここにテキストが入ります。<br> ここにテキストが入ります。</p> </div> </div> 【CSS】 /*メイン大枠部分*/ #main { margin: 0px; padding: 0px; width: 627px; float: right; background: #FFFFFF; height: auto; } /*各見出し*/ .mds01 h3 { background: url(img/mmds01.gif) no-repeat; margin: 25px 0px 15px; padding: 0px; height: 20px; width: 587px; font-size: 9px; color: #FFFFFF; clear: left; float: none; } .mds02 h3 { background: url(img/mmds02.gif) no-repeat; margin: 25px 0px 15px; padding: 0px; height: 20px; width: 587px; font-size: 9px; color: #FFFFFF; clear: left; float: none; } /*ボックス*/ .box { margin: 0px; padding: 0px; height: auto; width: 587px; clear: left; } /*ボックス内・画像とテキスト*/ #main .box img { float: left; padding-right: 10px; } #main .box h5 { font: bold 14px "MS Pゴシック", Osaka; color: #022962; margin: 0px 0px 10px; padding: 0px; } .txt { font: normal 13px/16px "MS Pゴシック", Osaka; color: #333333; margin: 0px; padding: 0px; } em { visibility: hidden; }

  • HTML
  • 回答数4
  • ありがとう数2

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

  • ベストアンサー
  • readordie
  • ベストアンサー率57% (66/115)
回答No.3

ちょっと整理して、ブロック要素に赤いborderを付けました。 ブラウザで見ると、赤い枠で囲まれたブロック要素は指定どおりになっているかと思います。 imgがboxからはみ出ていますね。なぜかというのは参考URLを見るとわかります。 この状態だと、<div class="box">の高さを決めているのは その中の<h5>と<p>の合計の高さです。ブラウザのデフォルトスタイルは差があるので、それで高さが変っているのではないでしょうか。 <!-- htmlここから --> <div id="main"> <h3 id="mds01"><em>見出し001</em></h3> <div class="box"> <img src="img/photo00.jpg" width="155" height="108"> <h5>小見出し</h5> <p class="txt">ここにテキストが入ります。<br><br> ここにテキストが入ります。<br> ここにテキストが入ります。</p> </div> <div class="box"> <img src="img/photo00.jpg" width="155" height="108"> <h5>小見出し</h5> <p class="txt">ここにテキストが入ります。<br><br> ここにテキストが入ります。<br> ここにテキストが入ります。</p> </div> <h3 id="mds01"><em>見出し002</em></h3> <div class="box"> <img src="img/photo00.jpg" width="155" height="108"> <h5>小見出し</h5> <p class="txt">ここにテキストが入ります。<br><br> ここにテキストが入ります。<br> ここにテキストが入ります。</p> </div> </div> <!-- htmlここまで --> /*メイン大枠部分*/ #main { margin: 0px; padding: 0px; width: 627px; float: right; border: 1px solid red; } /*各見出し*/ #mds01 { background: url(img/mmds01.gif) no-repeat; margin: 25px 0px 15px; padding: 0px; height: 20px; width: 587px; font-size: 9px; border: 1px solid red; } /*ボックス*/ #main .box { width: 587px; clear: left; border: 1px solid red; } /*ボックス内・画像とテキスト*/ #main .box img { float: left; padding-right: 10px; } #main .box h5 { font: bold 14px "MS Pゴシック", Osaka; color: #022962; margin: 0px 0px 10px; padding: 0px; border: 1px solid red; } #main .box p.txt { font: normal 13px/16px "MS Pゴシック", Osaka; color: #333333; margin: 0px; padding: 0px; }

参考URL:
http://www.techdego.com/2007/01/floatcssclearfix.php
akoblue
質問者

お礼

こちらの方法で解決できました! ありがとうございます。 ソースを全て書いてくれていた為、とてもわかりやすかったです。 助かりました。本当にありがとうございます。

その他の回答 (3)

  • kuzumiHK
  • ベストアンサー率72% (132/183)
回答No.4

No.1です。少し時間ができたのでmacで検証してみました。 floatの多用が原因で、IEのバグ?でmarginがうまく機能していないようです。(WindowsでもIE以外のブラウザではずれが生じていませんか?) 解決策として、marginで余白を取っている部分を、 なるべくpaddingに変更するとかなりの部分で差異が解消されると思います。 (borderを使っている場合など、どうしてもmarginで余白を取らなければならない場合、条件付コメントやハックなどでIE6だけにスタイルを適用する必要がありそうです) 必要最小限、修正したほうがよさそうな部分をまとめてみました。 (1)marginでの余白を0にし、paddingで余白を調整する。 (2)余白をすべて一度クリアにするため、 以下をスタイルシートに追加する *{ margin:0; padding:0; } (3)imgをpタグ(クラス付)やh4、h5タグなどブロック要素で囲い、 スタイルの「#main .box img」を、 「#main .box p.クラス(#main .box h4)」に変更する。 以上の3点です。

akoblue
質問者

お礼

問題点のご指摘、ありがとうございます。 自分では気付かない部分だった為、とても参考になりました。

  • miya_00
  • ベストアンサー率47% (9/19)
回答No.2

まず最初に聞きたいのですが、ブラウザスタイルの初期化って行っていますか? 今書いて頂いたCSSが全てではないと思うので確認させて下さい。 ちなみに自分で試した所。 h3 { padding:0; margin:0; } をはじめに指定し、 marginではなくpaddingで上下の幅を指定したら、IE7、FF2.0では同じ表示になりました。 それ以外はためしてないのですが、たぶん大丈夫だと思います。 もし駄目なら対処法として .boxにclearfixを指定する。 <h5>小見出し</h5> <p class="txt">ここにテキストが入ります。<br><br> ここにテキストが入ります。<br> ここにテキストが入ります。</p> を<div>で囲い、そのdivにfloat: right;をかけてみて下さい。 clearfixについてわからなかった場合は、 http://www.css-lecture.com/log/css/013.html

akoblue
質問者

補足

アドバイスありがとうございます。 ブラウザスタイルの初期化とは、CSS内に下記のコードを書き込む事でよろしいでしょうか? * { margin: 0px; padding: 0px; border: 0px; font-size: 100%; font-style: normal: } 今回、アドバイス頂いた方法でも、MacのSafariではうまく表示されませんでした。 原因をもう少し探ってみようと思いますので、その時に、別トピにて改めて質問をさせて頂きます。 clearfixのアドバイスもありがとうございました。

  • kuzumiHK
  • ベストアンサー率72% (132/183)
回答No.1

<br style="clear: both;" />を削除して、 .mds02{clear: both;}でいかがでしょうか。

akoblue
質問者

補足

ご回答ありがとうございます。 ご指摘の方法でやってみたのですが、 mds02の上部のマージン:25pxが無視されてしまうんです。 Safariですと、見た目10px程度の余白になってしまいます。 Firefoxですと5px程度です。 引き続き、アドバイスお願い致します。

関連するQ&A

  • (CSS)画像が完全に右端に寄りません・・・

    CSS勉強中でソースの不備が多々あると思いますがどうかみていただけますでしょうか・・。 <div class="bar">の画像の一番端の右下に<p class="px">の画像を隙間無く持ってきたいのですがどうしても<p class="px">の右側が空いてしまいます・・。対処方法がございますでしょうか。 根本からソースが違うかもしれません・・何卒お願いいたします! .pattern_box { width:708px; padding:0px 26px; text-align:right; } .pattern_box .bar { width:708px; margin:0px; } .pattern_box .px { float: right; display: inline; margin: 0px 0px 10px auto; text-align:right; } .pattern_box .inner { margin:10px 0px 0px 0px; text-align:left; font-size:12px; line-height:18px; } ★HTML <div class="pattern_box"> <div class="bar"> <img src="h2_bar01.gif" alt="" width="708" height="20"> </div> <p class="px"><img width="145" height="62" src="h2_bar01_ill.gif"></p> <div class="inner">テキストテキストテキスト</div> </div><!--pattern_box-->

    • ベストアンサー
    • CSS
  • <div>この余白は・・・

    <div>で作ったボックスの中に、さらに<div>のボックスを二つ(box、box2)並べたいのですが、float:leftでboxを左に寄せると、次に回り込んで表示されるbox2との間にかなりの余白があります。 CSSでbox、box2にmarginは指定していないのですが、この余白は何なんでしょうか? また、このbox、box2をある程度間に余白を持たせた上でセンタリングしたいのですが、これもなぜかうまくいきません・・・。 ▼HTML <div class="out">  <div class="title">   <img src="img/title.jpg" width="700" height="75" border="0">  </div>  <div class="main">   <img src="img/main.jpg" width="700" height="375" border="0">  </div>  <div class="menu">   <img src="img/home_a.jpg" width="100" height="35" border="0">   <img src="img/first.jpg" width="100" height="35" border="0">   <img src="img/info.jpg" width="100" height="35" border="0">   <img src="img/order.jpg" width="100" height="35" border="0">   <img src="img/support.jpg" width="100" height="35" border="0">   <img src="img/link.jpg" width="100" height="35" border="0">   <img src="img/question.jpg" width="100" height="35" border="0">  </div>  <div class="area">   <div class="box">    <h5>AAAAAAAAA</h5>    <img src="img/kari.gif" width="250" height="100" border="0">   </div>   <div class="box2">    <h5>BBBBBBBBB</h5>    <img src="img/kari2.gif" width="250" height="100" border="0">   </div>  </div> </div> ▼CSS div.out{ width:700px; background-color:#ffffff; } div.main{ border-style:solid none solid none; border-width:10px; border-color:#666666; } div.menu{ margin-bottom:50px; } div.area{ text-align:center; padding:0.7em; border:solid; border-color:red; } div.box{ float:left; width:250px; border-style:none solid solid solid; border-width:1px; border-color:#99ccff; background-color:#99ccff; } div.box2{ width:250px; border-style:none solid solid solid; border-width:1px; border-color:#99ccff; background-color:#99ccff; } h5{ margin-bottom:0px; padding:0.5em; }  どなたか知恵をお貸しください。よろしくお願いいたします。

    • ベストアンサー
    • HTML
  • HTML、CSS が、なかなかうまくいきません。

    お世話になります。 HTMLを始めたばかりですので、 ご教授いただけたら幸いです。 以下の図のような感じに並べたいのですが、 なかなかうまい具合にいきません。 黄色は、全てボタンになります。 赤は、ボタンについた吹き出し部分となります。 上段の2つのボタンは、やや大きい感じのボタン。 下段の3つのボタンは、上段に比べて、少し小さい感じのボタンになります。 ボタンは、上段(A)と下段(B)で、 HTML と CSS は、分けようかと考えています。 【HTML】 <div class="Button"> <div class="contents"> <div class="Button_boxA clearfix"> <div class="Yellow_Btn_01"><img src="img/Yellow_Btn_01.png" width="200" height="75" /> </div> <div class="Yellow_Btn_02"><img src="img/Yellow_Btn_02.png" width="200" height="80" /> </div> </div> <div class="btn_boxB clearfix"> <div class="Yellow_Btn_03"><img src="img/Yellow_Btn_03.png" width="100" height="60" /> </div> <div class="Yellow_Btn_04"><img src="img/Yellow_Btn_04.png" width="100" height="65" /> </div> <div class="Yellow_Btn_05"><img src="img/Yellow_Btn_05.png" width="100" height="60" /> </div> </div> </div> </div> 【 CSS 】 div.Button{ width:600px; margin-top:20px; margin-right:auto; margin-left:auto; padding-right:25px; } div.btn_boxA{ width::500px; margin-left:auto; margin-right:auto; margin-bottom:10px; } div.low_btn_01{ width:200px; height:75px; margin-left:auto; margin-right:auto; margin-bottom:10px; float:left; } div.low_btn_02{ width:200px; height:80px; margin-left:auto; margin-right:auto; padding-left:25px; margin-bottom:10px; float:left; } div.btn_boxB{ width::500px; margin-left:auto; margin-right:auto; margin-bottom:10px; } div.low_btn_03{ width:100px; height:60px; margin-left:auto; margin-right:auto; margin-bottom:10px; padding-left:25px; float:left; } div.low_btn_04{ width:100px; height:65px; margin-left:auto; margin-right:auto; margin-bottom:10px; padding-left:25px; float:left; ] div.low_btn_05{ width:100px; height:60px; margin-left:auto; margin-right:auto; margin-bottom:10px; padding-left:25px; float:left; } 長ったらしくなってしまいましたが、 ご教授いただけたら、幸いです。 宜しくお願いします。

    • 締切済み
    • CSS
  • cssでボックスを横並びにし、横幅指定してもくっついてしまう。

    こんにちわ! 只今CSS課題に取り組んでいるのですが、 フロートを使用し、写真(A)、テキスト(B)、写真(C)、テキスト(D)、と並べたいのですが、(B)に横幅指定しているにもかかわらず、(C)がIEではOKなのですが、FIREFOXではぴたっとくっついてしまいます。 【html】 <div class="box"> <div class="photo"><img src="img/photo_01.jpg" width="132" height="85"></div> <div class="txt">第23回こまったな<br>どうしたのかな賞<br>受賞</div></div> <div class="box"> <div class="photo"><img src="img/photo_02.jpg" width="132" height="85"></div> <div class="txt">第23回どなたかー<br>助けてください賞<br>受賞</div></div> </div> .box{ width : 258 px; margin: 0px; float:left; } .photo{ width : 132 px; margin: 0px; float:left; } .txt{ width : 123 px; color: #555555; font-size: 12px; text-align: left; margin: 0px 0px 0px 3px; padding: 0px ; line-height:18px; float:left; } となっております。 何故、IEでは大丈夫でFirefoxでは内容によって横幅が変わってしまうのでしょうか? ご教授願いませんでしょうか~? 宜しくお願い致します。

    • ベストアンサー
    • HTML
  • HTML CSSを、教えてください。

    お世話になります。 HTMLを始めたばかりで、 超初心者ですので、ご教授いただけたらと思います。 以下の図のような感じに並べたいです。 バックグラウンドには、青色。 赤と緑の部分は、画像配置、 また、右の緑の画像の上に, オレンジのボタン配置を行いたいのです。 ただ、オレンジのボタン配置の仕方が、 なかなか出来ずにいます。 以下のHTMLとCSSには、 オレンジのボタンを入れずに、まず配置をしてみましたが…。 ただ、やはり右の緑の画像が、崩れてしまう感じも…。 オレンジのボタンを入れていただいた形で、 お願いできないでしょうか? (オレンジ画像 width=100 height=50 でお願いします。) 【 HTML 】 <div class="Red"><img src="img/Red.png" width="300" height="50" /> <div class="contents"> <div class="Color_Box"> <div class="Green01"><img src="img/Green01.png" width="200" height="100" /> </div> <div class="Green02"><img src="img/Green02.png" width="200" height="100" /> </div> </div> </div> </div> 【 CSS 】 div.Red{ background:url(img/Bule.png) 0 100% repeat-x; height:200px; margin-top:45px; text-align:center; } div.Color_box{ width:450px; height:100px; } div.Green01{ width:200px; padding-right:50px; float:left; } div.Green02{ width:200px; float:left; }

    • 締切済み
    • CSS
  • CSSでロールオーバーを作って中央揃えにしたい。

    CSSを使ってロールオーバーを作成しました。 がんばっているのですが、なかなか難しく、壁ばかりです。 なんとか、ロールオーバーは出来たのですが、その画像が左揃えになっていて、中央揃えにならないのです。 どなたか、お力をお貸しください。よろしくお願い致します。 HTML ----------------------------------- <link href="css.css" rel="stylesheet" type="text/css"> <div class="contents_box2"> <h3 class="no"><a href="info.html"><img src="contents_img2_1.jpg" alt="教室のご案内" width="215" height="53" /></a></h3> <p class="contents_text2">ああああああああああああああああああああああああああああああああああああああああああああああああ <p class="contents_text2">あああああああああああああああああああああああああああああああああああああああああああああああああああああああ <p class="contents_text2"><br /> <div class="rollover01"><a href="info.html"><img src="button2.jpg" alt="詳しくはこちら" width="172" height="29" /></a></div> <img src="contents_img2_3.jpg" width="215" height="18" /></div> -------------------- css↓↓↓ ------------- BODY { COLOR: #666666; TEXT-ALIGN: center; margin-top: 0px; font: 12px/130% "MS Pゴシック", Osaka, "ヒラギノ角ゴ Pro W3"; } IMG { BORDER-RIGHT: 0px; BORDER-TOP: 0px; VERTICAL-ALIGN: bottom; BORDER-LEFT: 0px; BORDER-BOTTOM: 0px; margin: 0px; padding: 0px; } .contents_box2 { FLOAT: left; MARGIN: 0px 12px 0px 0px; WIDTH: 215px; TEXT-ALIGN: left; padding: 0px; background: url(contents_img2_2.jpg) repeat-y; } .contents_text2 { MARGIN: 10px 16px 0px } .contents_detail { PADDING-RIGHT: 0px; PADDING-LEFT: 0px; PADDING-BOTTOM: 0px; WIDTH: 215px; PADDING-TOP: 0px; TEXT-ALIGN: center } .rollover01 { width:172px; height:29px; background:url(img/button3.jpg) no-repeat center bottom; text-align: center; } .rollover01 a { display:block; width:172px; height:29px; font-size:1px; line-height:1px; outline:none; text-align: center; } .rollover01 a:hover { text-indent:-9999px; } -------------------------------------

  • safariだけ、cssが効きません!

    こんばんは。css入門者です。 Firefoxなどは大丈夫なのですが、safariだけ、 .staffのmargin-bottom:20px;が効きません。 どこが間違ってるのかわからず、困っています。 どうぞよろしくお願いいたします。 <div class="staff"> <p class="staff_name"><img src="img/name_shige.gif" width="107" height="85" alt="ああ)" /></p><br /> <p class="staff_word">いいいいいい</p> <div class="clearfix"><hr /></div> </div><!-- staff end --> ------------------------ .staff { width:670px; margin-bottom:20px; background-color:#d1ece6; line-height:150%; } .staff_name { float:left; margin:0px; } .staff_word { background-color:#FFF; margin:0px 20px 20px 107px; padding:7px; }

    • 締切済み
    • CSS
  • css 各divの内容を上に揃えたいです。

    こんにちは、初心者です。宜しくお願いします。 <main>の右は<side2>ですが、mainの画像BBBの真横に、side2の内容が表示されず、真横ではなくて、BBBのやや斜め右下に表示されるんです。 全体を中央揃えにしてから、このような問題にぶつかりました。 mainとside2の内容を上先頭で揃え、ブラウザの大きさを変えても中央を基準に内容も動くようにしたいです。 ご教授のほど、よろしくお願い致します。 ---------------------------------------------- <html> <head> <title>○○</title> <link href="design/shop_index02.css" rel="stylesheet" type="text/css"> </head> <body> <div class="contents"> <div class="top"> <h1>○○</h1> <h2> ○○</h2> </div> <div class="middle"> <a href="○○"> <img src="../img/logo.gif"></a> </div> <div class="main"> <a href="●●"> <img src="BBB"></a> </div> <div class="side2"> <a href="●●"> <img src="●●.gif"></a> <h3>●●</h3> <p>●●</p> </div> </div> </body> </html> ---------------------------------------------- /*ページのレイアウト用css*/ body{ margin:0px; padding:0px; background-color:#BDB76B; text-align:center; } body a img{ border: none; } .contents{ width:900px; height : 2700px; background-image:url(○○); margin:auto; text-align:left; clear:both; } h1{ color:#c0c0c0; font-size:12px; text-align:center; font-family:"MS 明朝"; } h2{ font-size:10px; font-family:"MS P明朝","細明朝",serif; color:#c0c0c0; margin-left:8px; } h2 a{ font-family:"MS ゴシック","osaka,sans-serif"; font-size:10px; color:#CC6600; } h3{ font-size:13px; font-family:"MS P明朝","細明朝",serif; color:#669900; } h3 img{ margin-left:720px; } .top{ width:900px; height:170px; margin-left:80px; } .middle{ width:900px; height:170px; margin-left:100px; color:#999999; margin-top:40px; } .main { width:700px; margin-top:60px; margin-left:80px; float:left; } .side2{ width:200px; margin-top:60px; margin-left:700px; } .side2 p{ color: #999999; font-family:"MS P明朝","細明朝",serif; font-size:10px; width:160px; text-align:left; } .side2 a{ color:#CC6600; text-decoration:none; }

    • ベストアンサー
    • HTML
  • cssレイアウトで表を作成したいです。

    添付した画像の様な表組みをテーブルタグを使用せずに作成するのは可能なのでしょうか? もしくは表はテーブルタグを使用したほうが、ソースの量は少なくて済むのでしょうか 全体を囲うBoxAは"height:auto;"を指定してボックスBoxBのテキストの量によって可変する。BoxCのテキストは常にBoxBの最下行と揃える。 /*css*/ .BoxA{ width:490px; height:auto; margin:0px auto 10px auto; background-color:#999999; border:solid #999999 1px;} .BoxA .BoxB{ width:350px; height:auto; margin:0px; padding:5px; float:left; background-color:#fffbfb;} .BoxA .BoxC{ width:129px; height:auto; margin:0px; padding:0px; float:right; background-color:#fffbfb; } .clearfloat { clear:both;} <!--ソース--> <div class="BoxA"> <div class="BoxB"> <p>■■■■■■■■■■<br /> ■■■■■■■■■■<p/> </div> <div class="BoxC"> <p style="margin:auto 0px 0px;">■■■■■■■■■■</p> </div> <br class="clearfloat" /> </div>

    • ベストアンサー
    • HTML
  • HTMLとCSSの記述で表示がうまくされません

    現在HTMLとCSSを使ってウェブのページを作っているのですが どうしても思ったように表示が出来ません。 HTMLの他にCSSの記述を記載致しました。 なにが出来ないかと申しますと 下記の <p class="section"> <h2>解決できる方法</h2> <img src="mark.gif" alt="*" width="14" height="18"><font color="#FF0000">再短時間と最小の労力で職場や学校のマルマルが解決できる方法!!</font> 心理学の知識がない人でも簡単にできた<br> あまりにも効果的な<font color="#FF0000">『門外不出』</font>の<font color="#FF0000">aaaaa</font>対処法とは? </p> 記述部分を枠の中に入れたいのですが、どうしても外に出て表示されてしまいます。 どなたか解決方法をご存知の方はお教え頂けないでしょうか? HTMLの記述がこちらになっております。 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 4.01//EN" "​http://www.w3.org/TR/html4/strict.dtd">​ <html lang="ja"> <meta http-equiv="Content-Type"content="text/html;charset=shift_jis"/> <head> <title>aaaa</title> <meta http-equiv="description"content="bbbb"> <meta http-equiv="keywords"content=""> <link rel="stylesheet" type="text/css" href="index.css" media="all"> </head> <body> <p class="head"><span lang="en"></span></p> <h1></h1> <div class="img"><img src="header.gif" alt="" width="800" height="165"></div> <div class="menu"> <a href="index.html"><img src="navi_top.gif" width="195" height="35" alt="top"></a> <a href="02.html"><img src="navi_ijime.gif" width="195" height="35" alt=""></a> <a href="03.html"><img src="navi_shokuba.gif" width="195" height="35" alt=""></a> <a href="04.html"><img src="navi_plofile.gif" width="195" height="35" alt=""></a> </div> <p class="section"> <h2>解決できる方法</h2> <img src="mark.gif" alt="*" width="14" height="18"><font color="#FF0000">再短時間と最小の労力で職場や学校のマルマルが解決できる方法!!</font> 心理学の知識がない人でも簡単にできた<br> あまりにも効果的な<font color="#FF0000">『門外不出』</font>の<font color="#FF0000">aaaaa</font>対処法とは? </p> <p class="text_bg"> <div class="text">text</div> </p> </body> </html> CSSの記述がこちらになっております。 body{ text-align:center; width:800px; } p{ text-align:center; font-size:0.85em; color:#333333; } p.head { font-size:0.6em; font-family:"MS Pゴシック", Osaka, "ヒラギノ角ゴ Pro W3"; font-weight:bold; color:#666666; text-align:left; margin-bottom:0px; } .img{ margin-top:0; margin-bottom:0; } .menu { padding-left:1px; margin-bottom:0; margin-top:0; } h1{ font-size:0.5em; display:none; } h2{ font-size:0.5em; display:none; } h2 img{ vertical-align:middle; } .mark{ margin-right:10px; } .section{ font-family:"MS Pゴシック", Osaka, "ヒラギノ角ゴ Pro W3"; margin-bottom:0px; margin-top:0px; background-image:url(back_01.gif); background-repeat:no-repeat; width:800px; height:165px; color:#666666; font-size:1em; } p.01{ text-align:center; font-size:1.05em; font-family:"MS Pゴシック", Osaka, "ヒラギノ角ゴ Pro W3"; } p.text_bg{ background-image:url(back_02.jpg); background-repeat:no-repeat; margin-top:10px; width:800px; height:365px; } .text{ margin-top:10px; text-align:center; }

    • ベストアンサー
    • HTML

専門家に質問してみよう