• 締切済み

HTMLの質問です。

HTMLのコーディングのご質問です。自分ではどうしても解決できず、皆さんにご協力をお願いしたいです。 グーグルクロムのブラウザで見た場合は、どうしても一番下に隙間ができてしまいます。 ソースは下記の通りです。 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> <meta name="keywords" content="" /> <meta name="description" content="" /> <meta http-equiv="Content-Style-Type" content="text/css" /> <meta http-equiv="Content-Script-Type" content="text/javascript" /> <link rel="stylesheet" href="test.css" type="text/css" /> </head> <body> <div id="wrap"> テスト<br />テスト<br />テスト<br /> テスト<br />テスト<br />テスト<br /> テスト<br />テスト<br />テスト<br />テスト<br /> テスト<br />テスト<br />テスト<br />テスト<br /> テスト<br />テスト<br />テスト<br />テスト<br /> テスト<br />テスト<br />テスト<br />テスト<br /> テスト<br />テスト<br />テスト<br />テスト<br /> テスト<br />テスト<br />テスト<br />テスト<br /> テスト<br />テスト<br />テスト<br />テスト<br /> テスト<br />テスト<br />テスト<br />テスト<br /> テスト<br />テスト<br />テスト<br /> テスト<br />テスト<br />テスト<br /> テスト<br /></div></body> </html> ------------------------------------ CSS ------------------------------------ @charset "UTF-8"; body,div,h1,h2,h3,h4,h5,h6, p,blockquote,pre,address, ul,ol,li,dl,dt,dd, form,fieldset,legend { margin: 0; padding: 0; font-family: "MS Pゴシック","ヒラギノ角ゴ Pro W3",Meiryo, "Hiragino Kaku Gothic Pro", Osaka, "MS PGothic", sans-serif; line-height: 0%; } html { overflow-x:hidden; overflow-y:scroll; } html, body { height:100%; } /*font-size*/ body { font-size: 10px; _font-size:62.5%;/*IE6*/ margin:0px; padding:0px; background: #F5F5F5; color:#000; line-height:1.4; } input,textarea { font-family:Arial,Helvetica,sans-serif; } img,object { margin: 0; padding: 0; border: 0; vertical-align:bottom; } /*table*/ table { border-collapse: collapse; border-spacing: 0; } p { text-align: justify; text-justify: distribute; } /*clearfix*/ /*height0.1px font-size0.1em*/ .clearfix:after, div:after { content: "."; display: block; height: 0.1px; font-size: 0.1em; clear: both; visibility: hidden; } .clearfix { display: inline-block; }/*IE7p*/ .clear { clear:both; } /* Hides from IE-mac */ * html .clearfix { height:1%;} .clearfix { display:block;} /* End hide from IE-mac */ ul, li { list-style:none; margin:0px; padding:0px; } strong { font-weight: normal; } em { font-style: normal; } address { font-style: normal; } body { background: #FAF5CF; height: 0%; line-height: 0%; } h1,h2,h3,h4,h5,h6, p,blockquote,pre,address, ul,ol,li,dl,dt,dd, form,fieldset,legend{ line-height: 100%; } #wrap { background: #FFFFFF; width: 906px; margin: 0 auto; padding:0; line-height: 160%; } ----------------------------- #wrapには高さを指定せずに使いたいと考えています。 お手数をおかけしますがよろしくお願いします。

  • CSS
  • 回答数3
  • ありがとう数0

みんなの回答

回答No.3

原因はおそらく .clearfix:after, div:after { content: "."; display: block; height: 0.1px; font-size: 0.1em; clear: both; visibility: hidden; } です。 とりあえずこれを消したら大丈夫なんじゃないかなと。

  • tracer
  • ベストアンサー率41% (255/621)
回答No.2

この質問にこのまま回答がつかない理由があるとすれば、あなたのいうところの「隙間」を誰も理解できないからだと思います。

  • ORUKA1951
  • ベストアンサー率45% (5062/11036)
回答No.1

★グーグルクロムのブラウザで見た場合は、どうしても一番下に隙間ができてしまいます。  HTMLに対して、根本的な誤解があります。HTMLは本来 【引用】____________ここから HTMLは、どんな環境からもWebの情報を利用できるようにすべきだという方針の下に開発されている。例えば、様々な解像度や色深度のグラフィックディスプレイを持つPCや、携帯電話、モバイル機器、音声入出力機器、帯域が広いコンピュータや狭いコンピュータ、等の環境である。  ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ここまで[Introduction to HTML 4 (ja)( http://www.asahi-net.or.jp/%7Esd5a-ucd/rec-html401j/intro/intro.html#h-2.2.1 )]より  のためのものです。ワープロやDTP( http://ja.wikipedia.org/wiki/DTP )とは、根本的に違うもので、そこまで表示にこだわるなら他の規格を使うべきです。今は携帯電話やiphoneでの訪問者も多い。そしてなよりも検索エンジンが・・ 必要もないのに、なぜTransitionalなのか・・strictだとほぼすべてのブラウザで標準モードで表示される。 不必要にmarginやpaddingを0と初期化しない。要素が登場するたびに改めて指定させられる。html,body程度にとどめておこう。 heightは、ウィンドウ高さを参照できません。(IE6の互換モードだと参照するが、それはバグです。!!)   ・・HTMLの本来の目的(様々なUAに対応)からも、参照すべきではない 継承や詳細度をきちんと把握してCSSを書きましょう。十数行ですむものがメンテナンス不能の膨大なものになってしまう。 font-family:は継承されるのでhtmlないしbody一箇所の指定でよい。 示されたHTMLとCSSが当てはまりません、 #wrapとか、意味のないID,class名は使わないようにしましょう。

関連するQ&A

  • CSSでの背景色の指定について

    以下のソースで右下に空白ができます。 それはいいのですが、背景色を指定がうまく行きません。 heightは動的に変わるので、idやclassを増やさずに実現したいと考えています。 IEでは実現できてきますが、Firefoxではダメでした。 よい方法はないでしょうか? ■test.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=euc-jp"> <link href="css/test.css" rel="stylesheet" type="text/css" /> <title>test</title> </head> <body> <div id="wrap"> <div id="left"> AAAAAAAAAA<br /> AAAAAAAAAA<br /> AAAAAAAAAA<br /> AAAAAAAAAA<br /> AAAAAAAAAA<br /> AAAAAAAAAA<br /> AAAAAAAAAA<br /> AAAAAAAAAA<br /> AAAAAAAAAA<br /> </div> <div id="right"> ああああ<br /> ああああ<br /> ああああ<br /> ああああ<br /> </div> </div> </body> </html> ■test.css body { margin-top: 20px; margin-left: 70px; margin-bottom: 0px; padding: 0px; line-height: 1.4em; font-size: 12px; font-weight: normal; color: #333333; } #wrap { width: 690px; background-color: #000000; } #left { margin: 0px; padding: 0px; width: 510px; height: 100%; float: left; background-color: #ffff00; } #right { margin: 0px; padding: 0px; width: 180px; float: right; background-color: #ff00ff; }

    • ベストアンサー
    • CSS
  • div入れ子による height100%

    お世話になります。 親要素のdivは縦100%になるのですが、 入れ子のdivが縦100%にならず困っております。 検証ブラウザは、IE6、IE7、FF2、Safariです。 お分かりの方、ご教授をお願いいたします。 ▼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=shift_jis" /> <title>test</title> <style type="text/css"> <!-- html { height:100%; } body { height:100%; margin:0; padding:0; } #wrapper { background: #99CC00; width:500px; margin-left:auto; margin-right:auto; min-height:100%; } #wrapper-inner { background:#CCFF00; width:450px; margin-left:auto; margin-right:auto; min-height:100%; } #contents { background: #FFFFCC; width:400px; margin-left:auto; margin-right:auto; min-height:100%; } * html #wrapper { height: 100%; } * html #wrapper-left { height: 100%; } * html #wrapperA { height: 100%; } --> </style> </head> <body> <div id="wrapper"> <div id="wrapper-inner"> <div id="contents"> テスト <br /> <br /> <br /> <br /> <br /> <br /> <br /> <br /> <br /> <br /> <br /> <br /> <br /> <br /> <br /> <br /> </div> </div> </div> </body> </html>

    • ベストアンサー
    • CSS
  • DIV要素の高さ100%で、スクロールバーを表示させたいです

    ソースは以下のとおりです。 DIV要素をheight:100%にして画面全体に広げるために、色々CSSで設定していましたところ、Firefoxでしたら縦スクロールバーが表示されるのですが、IE6では縦スクロールバーが表示されません。(左カラムの文字はかなり下まで続いています) IEでもスクロールバーが表示されるようにしたいと思います。 よろしくお願いいたします。 <!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" lang="ja" xml:lang="ja"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <meta http-equiv="Content-Style-Type" content="text/css" /> <meta http-equiv="Content-Script-Type" content="text/javascript" /> <meta http-equiv="imagetoolbar" content="no" /> <title>サンプル</title> <style type="text/css"> <!-- /*全体の設定*/ * { margin: 0px; padding: 0px; font-size: 12px; font-family:'Georgia', Verdana, Osaka, 'MS P Gothic'; font-weight: normal; line-height: 150%; color: #000; } /*ページ全体の設定*/ html,body { height:100%; } body { background-color: #FFF; } /*カラムの設定*/ #wrapper { width: 1001px; float:left; height: 100%; min-height:100%; margin: 0px 0px 0px 0px; overflow:hidden; } body > #wrapper { height:auto; } /*左カラムの設定*/ #left { width: 340px; margin: 0px; float: left; height: 100%; min-height: 100%; background-color:#FF0000; padding-bottom: 32768px; margin-bottom: -32768px; } /*右カラムの設定*/ #right { width: 660px; margin: 0px; float: right; height: 100%; min-height: 100%; border-left-width: 1px; border-left-style: dotted; border-left-color: #000; background-color:#00FF00; padding-bottom: 32768px; margin-bottom: -32768px; } --> </style> </head> <body> <div id="wrapper"> <div id="left"> a<br /> a<br /> a<br /> a<br /> a<br /> a<br /> a<br /> a<br /> a<br /> a<br /> a<br /> a<br /> a<br /> a<br /> a<br /> a<br /> a<br /> a<br /> a<br /> a<br /> a<br /> a<br /> a<br /> a<br /> a<br /> a<br /> a<br /> a<br /> a<br /> a<br /> a<br /> a<br /> a<br /> a<br /> a<br /> a<br /> a<br /> a<br /> a<br /> a<br /> a<br /> a<br /> a<br /> a<br /> a<br /> a<br /> a<br /> a<br /> a<br /> a<br /> a<br /> a<br /> a<br /> a<br /> a<br /> a<br /> a<br /> a<br /> a<br /> a<br /> a<br /> a<br /> a<br /> </div> <div id="right"> aaaa </div> </div> </body> </html>

  • Firefoxのみborderが消える現象

    お世話になっております。 以下のソースのように、ページを左カラムと右カラムに分けて上から下までカラムをheight:100%にしているます。右カラムの左にボーダーをドットで入れているのですが、IEでは表示されるborderがFirefoxでは表示されません。解決方法をご教授お願いいたします。 <!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" lang="ja" xml:lang="ja"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <meta http-equiv="Content-Style-Type" content="text/css" /> <meta http-equiv="Content-Script-Type" content="text/javascript" /> <meta http-equiv="imagetoolbar" content="no" /> <title>サンプル</title> <style type="text/css"> <!-- /*全体の設定*/ * { margin: 0px; padding: 0px; font-size: 12px; font-family:'Georgia', Verdana, Osaka, 'MS P Gothic'; font-weight: normal; line-height: 150%; color: #000; } /*ページ全体の設定*/ html,body { height:100%; } body { background-color: #FFF; } /*カラムの設定・IE6のハック*/ #wrapper { width: 1001px; float:left; height: 100%; min-height:100%; margin: 0px 0px 0px 0px; overflow:hidden; overflow: show; } body > #wrapper { height:auto; } /*左カラムの設定*/ #left { width: 340px; margin: 0px; float: left; height: 100%; min-height: 100%; padding-bottom: 32768px; margin-bottom: -32768px; background-color:#00FF00 } /*右カラムの設定・IEバグ対策*/ #right { width: 660px; margin: 0px; float: right; height: 100%; min-height: 100%; border-left-width: 1px; border-left-style: dotted; border-left-color: #000; padding-bottom: 32768px; margin-bottom: -32768px; position:relative; } --> </style> </head> <body> <div id="wrapper"> <div id="left"> aaa </div> <div id="right"> aaa </div> </div> </body> </html>

  • スタイルシートを使用したサイト作りで

    サイトページの真ん中に450pxの白の柱に本文を入れ、周りをすべて黒というスタイルにしたく思ってます。 柱をウィンドウの上から下まで表示したいのですが、どうしてもうまくいきません。どうぞ御指南下さい!!作ったタグを載せます。 *{margin:0; padding:0; font:normal normal normal x-small/1.5em Verdana,"MS ゴシック",Osaka,Gothic,sans-serif;} body{ height:100%; background-color:#000000; color:#000000; cursor:default;} br{ letter-spacing:normal;} #body{margin:0px auto; width:450px; height:100%; background:#ffffff;} #header{padding:0px} #menu{padding:0px 0px 5px; text-align:center;} #main{padding:0px 10px;} #navi{text-align:right; padding:0px 10px;} #foot{height:123px; background:url(img/img2.gif) no-repeat 0% 0%;} .text{padding:0px 0px 10px;} p{padding:1px 0px;} h1,h2{font-weight:bold;} h1{text-align:center; color:#666666; font-size:190%; padding:10px 0px 0px;} h2{ text-align:left; color:#000000; font-size:100%; padding:0px 2px; margin:5px 0px;} サイトページ <body> <div id="body"> <div id="menu"> <h1 id="TOP">- ABOUT - </h1> </div> <hr class="none"> <hr class="none"> <div id="main"> <h2>test</h2> <div class="text"> <p>test</p> </div> <h2>test</h2> <div class="text"> <p> test </p> </div> </div> <div id="navi"> <p>INDEX // <a href="#TOP">PAGE TOP</a> // </p> </div> </div> </body> </html>

  • フレームHTMLについて。

    サイトを作るにあたって、画面を二分割にしようと思っていますが、どうにも作る事が出来ません。 サイト様を見ても分からない上に、とりあえず解説通りに実行しても良く分からない事になる。・・そんな状態がかれこれもう4ヶ月になります。 もうサイト自体を諦めようか・・と思いましたが、最後にここで質問をして諦めるかどうかを決めようと思っています。 そんな私が恥を忍んでお願いをします。 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html lang="ja"> <!--made by Web Design Templates http://wdt.pekori.jp/--> <head> <meta http-equiv="content-type" content="text/html; charset=Shift_JIS"> <meta http-equiv="Content-Style-Type" content="text/css"> <title></title> <style type="text/css"> <!-- body{ margin: 0; font-size: 10pt;/*全体のフォントサイズ*/ } a{ color: #212122;/*リンクの色*/ text-decoration: none; } .leline{/*裏側の細線の設定*/ position: absolute; z-index: 1 top: 0; left: 100px; width: 10px; height: 100%; border-left: solid 1px #ABABAC;/*色*/ } .leline2{/*裏側の薄色部分と点線枠の設定*/ position: absolute; z-index: 1; top: 0; left: 120px; width: 130px;/*幅*/ height: 100%; border-left: dotted 1px #ABABAC;/*枠の色*/ border-right: dotted 1px #ABABAC; background-color: #FBFBFC;/*背景色*/ } .main{/*メニュー全体の位置と幅を設定*/ position: absolute; z-index: 2; top: 25px; left: 60px; width: 240px; } h1{/*SiteTitle部分の設定*/ font-size: 12pt; font-family: "Verdana"; font-weight: normal; letter-spacing: 0.2em;/*文字間隔*/ text-align: center; width: 220px; margin: 10px 10px 40px 10px; padding: 5px 15px 5px 15px; border: solid 1px #696969; background-color: #FFFFFF;/*背景色*/ } .menu{/*メニューの設定*/ margin: 10px;/*メニューごとの間隔*/ padding: 5px; border: solid 1px #696969;/*枠の色*/ background-color: #FFFFFF;/*背景色*/ font-family: Verdana; font-size: 10pt; } .text{/*「一言」部分*/ margin: 20px 10px 10px 10px; padding: 5px; border: solid 1px #696969; background-color: #FFFFFF; font-family: Verdana; font-size: 9pt; } .bottom{/*アドレス部分*/ margin: 40px 10px 10px 10px; padding: 5px; border: solid 1px #696969; background-color: #FFFFFF; font-family: Verdana; font-size: 7pt; text-align: center; } --> </style> </head> <body> <div class="leline"></div> <div class="leline2"></div> <div class="main"> <h1>Site Title</h1> <div class="menu">■ <a href="#">What's New</a></div> <div class="menu">■ Sitemap</div> <div class="menu"><span style="color: #AA4548">■</span> Text <span style="font-size: 8pt">- 12/13</span></div> <div class="menu">■ Photo</div> <div class="menu">■ Bookmark</div> <div class="text"> [一言スペース]<br> <br><br><br> </div> <div class="bottom">Since 2001.12.10 // E-mail</div> </div> </body> </html> ↑これに既にフレームを付けた状態のHTMLを切実に待っています。 これをインターネットで表示すると、http://wdt.pekori.jp/template/top/007/007_gray.html←の様になります。

  • ページの一番上にできた余分な余白の消し方

    ページの一番上に800×100の画像を用意し、それを背景画像として設定。 その上に<h1>のタイトルを表示しようとすると、 背景画像の上に無駄な余白ができてしまいます。 何か間違えているのでしょうか?この余白の消し方を教えてほしいです。 よろしくお願いいたします。 <html> <head> <title></title> <style type="text/css"> body { margin: 0; padding: 0; text-align: center; background-color: #000; color: #333333; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 100%; text-align: center; } div#container { width: 800px; background-color: #ffffff; text-align: left; margin: 0 auto; padding: 0; } div#header { width: 800px; height: 100px; background-image: url(image/sample.jpg); background-repeat: no-repeat; padding: 0; margin: 0; } h1 { padding-top: 15px; padding-right: 0; padding-bottom: 15px; padding-left: 0; font-size: 15px; font-weight: normal; line-height: 15px; margin-top: 30px; margin-right: 0px; margin-bottom: 0; margin-left: 0; color: #000; } div#mainContent { padding: 5px 15px 0 15px; } </style> </head> <body> <div id="container"> <div id="header"> <h1>テスト</h1> </div> </div> <div id="mainContent"></div> </body> </html>

    • ベストアンサー
    • HTML
  • ブラウザ上部に余白があります。

    近い現象はありましたが、解決出来なかったのでご質問させて頂きます。 下記のソースでhtmlを制作しましたが、#headerの上に余白があります。 どうすればこの余白をとる事が出来るでしょうか? お教え頂ければと思います。 ↓ソース↓ <!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> <style type="text/css"> <!-- html, body{ margin:0; padding:0; } div#header{ background-color: #F00; margin:0px; padding:0px; } --> </style> </head> <body> <div id="header"> <h1>test</h1> </div> </body> </html>

  • 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
  • 外部CSSと HEAD内のCSSの違い

    現在、macで Dreamweaver8を使用してHPを作っています。 外部のcssがうまく反映されません。 そこで、head内に同じcssを入れたところ、きちんと反映されました。 どうして違いがでるのか教えてください。 『head内に入れた時』 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=Shift_JIS"> <title>無題ドキュメント</title> <style type="text/css"> body { font-family: "MS Pゴシック", Osaka, "ヒラギノ角ゴ Pro W3"; font-size: 14px; font-weight: normal; background-position: center; padding: 0px; margin: 0px; } #page { background-color: #009900; height: 800px; width: 760px; margin-right: auto; margin-left: auto; position: relative; top: 0px; } #title { background-color: #CCFF00; height: 120px; width: 700px; position: relative; left: 0px; top: 0px; margin-right: 15px; margin-left: 15px; padding-right: 15px; padding-left: 15px; } </style> </head> <body> <div id="page"> <div id="title"> </div> </div> </body> </html> 『外部cssの時』 [styel.cssは] body { font-family: "MS Pゴシック", Osaka, "ヒラギノ角ゴ Pro W3"; font-size: 14px; font-weight: normal; background-position: center; padding: 0px; margin: 0px; } #page { background-color: #009900; height: 800px; width: 760px; margin-right: auto; margin-left: auto; position: relative; top: 0px; } #title { background-color: #CCFF00; height: 120px; width: 700px; position: relative; left: 0px; top: 0px; margin-right: 15px; margin-left: 15px; padding-right: 15px; padding-left: 15px; } [反映されるhtmlは] <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=Shift_JIS"> <title>無題ドキュメント</title> <link href="style.css" rel="stylesheet" type="text/css"> </head> <body> <div id="page"> <div id="title"> </div> </div> </body> </html> です。 誰かお答えくださいませ。

    • ベストアンサー
    • Mac