• ベストアンサー

adressを一番下に表示させたい

スタイルシート・スタンダード・デザインガイドという本を見ながらサイトを作っています。 サンプルを元にいろいろいじっていたらadressが一番下にくるはずなのに一番上に来てしまいます。 どうしたらいいでしょうか。 body { text-align:center; background-image:url(images/bg2.gif); background-color:#ffffff; } p.menu { border: 0; margin: 0; padding: 0; border:0; color:#ffffff; position:absolute; left:50px; top:50px; } p.menu img { margin:0; padding:0; } p.menu a{ padding:0; margin:0; background-color:#ffffff; } p.menu a:hover, p.menu a:active { background-color:#ffff99; } #menu2 { font-size:0.75em; margin-bottom:0; margin-top:50px; height:90%; width:197px; border:solid 1px #ff9999; position:absolute; left:50px; top:100px; background-color:#ffffff; } #menu2 a { color:#5e8eab; text-decoration:none; background-color:#ffffff; display:block; width:100%; line-height:2em } #menu2 a:hover { background-color:#c5e1ed } #menu2 span { color:#c5e1ed; display:none } .contents { width:580px; height:90%; margin-left:0; margin-right:0; margin-bottom:0; background-color:#ffffff; position:absolute; margin-top:20px; left:248px; top:130px; border:solid 1px #ff9999; } .section { margin-left:60px; margin-right:60px; text-align:left; margin-top:2em } address { font-size:0.625em; font-weight:bold; font-style:normal; color:#2d444f; position:absolute; text-align:center; text-valign:bottom; } address a { color:#2d444f; }

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

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

  • ベストアンサー
  • nachi_t
  • ベストアンサー率66% (10/15)
回答No.6

4と5で答えた者です。 枠の外の一番下という意味だったのですね。失礼しました。 HTMLの方は4のままで、スタイルシートだけ修正してみましょう。 ※5を基準にして説明します。 ●修正前 address { font-size:0.625em; font-weight:bold; font-style:normal; color:#2d444f; position:relative; text-align:center; text-valign:bottom; } ●修正後 address { font-size:0.625em; font-weight:bold; font-style:normal; color:#2d444f; position:absolute; left:0px; bottom:-30px; text-align:center; text-valign:bottom; } ※5の、「position:relative;」を「position:absolute;」に変更し、「left:0px;」と「bottom:-30px;」を追加しています。 個人的な意見ですが、「<address>」~「</address>」の下に余白がある方が見やすいかと思います。 下記のようにすると簡単に余白を入れられるので、お好みでお試し下さい。 ●修正後(下に余白あり) address { font-size:0.625em; font-weight:bold; font-style:normal; color:#2d444f; position:absolute; left:0px; bottom:-50px; padding-bottom:20px; text-align:center; text-valign:bottom; } ※5の、「position:relative;」を「position:absolute;」に変更し、「left:0px;」と「bottom:-50px;」と「padding-bottom:20px;」を追加しています。

pyupyuo2
質問者

お礼

回答ありがとうございました。 できました! マイナス、というのもアリだとは初めて知りました。 とても勉強になりました。 どうもありがとうございました。

その他の回答 (5)

  • nachi_t
  • ベストアンサー率66% (10/15)
回答No.5

4で答えた者です。 書き忘れたのですが、4の通りにしただけでは「<address>」~「</address>」は向かって右端に表示されるかと思います。 これを枠線内の中央に表示させたい場合は、スタイルシートを以下のように変更してみて下さい。 address { font-size:0.625em; font-weight:bold; font-style:normal; color:#2d444f; position:relative; text-align:center; text-valign:bottom; } ※「position:absolute;」を「position:relative;」に変更しています。

pyupyuo2
質問者

お礼

回答ありがとうございます。 4の通りにしたところ、本文の枠の一番下に表示されました。 5の通りにしたところ、本文の枠の中の、文の真下に表示されました。 私は枠の外の、ページの一番下に表示させたかったのですがどうもうまくいきません。 もしどうしてもダメなようなら、4の通りにやって妥協しようと思います。 もしまた思いついたら教えてください。 ありがとうございました。

  • nachi_t
  • ベストアンサー率66% (10/15)
回答No.4

問題はHTMLの方にあるので、スタイルシートは元のままで大丈夫です。 HTMLの「<address>」の直前に、「</div>」が2つありますよね? 2つめの「</div>」を、「</address>」の後に持って来て下さい。 それで問題なく表示されるかと思います。 ●修正前 </div> </div> <address> Copyright (C) <a href="mailto:admin@mail.address">Computer Technology Groups</a>. All rights reserved. </address> ●修正後 </div> <address> Copyright (C) <a href="mailto:admin@mail.address">Computer Technology Groups</a>. All rights reserved. </address> </div>

回答No.3

すいませんNo2ですが、ミスってます。 address { font-size:0.625em; font-weight:bold; font-style:normal; color:#2d444f; position:absolute; bottom:0px; left:0px; width:100%; text-align:center; } left:0px; を指定してください。 絶対指定なのに、left (right)が抜けてます。

pyupyuo2
質問者

お礼

再びありがとうございます。 ・・・今度は本文の枠の中の文章のすぐ下に来てしまいました。 ここで質問する前に色々試してみたのですがどうしてもうまくいかず やっぱり元に戻してやったほうがいいのかなぁ。。 きっとどこかが間違ってるんですよね。もう少し考えてみます。 ありがとうございました!

回答No.2

address { font-size:0.625em; font-weight:bold; font-style:normal; color:#2d444f; position:absolute; bottom:0px; width:100%; text-align:center; } に変更してください。

pyupyuo2
質問者

お礼

回答ありがとうございます。 試してみましたが、今度はページの真右に表示されました。 他の部分が間違ってるんでしょうか・・・ メインコンテンツ(本文)部分のDIVを絶対位置にしたとたん adressが真上に来たような気がしたのですが。 わざわざ考えてくださって感謝します。

  • MAN_MA_RUI
  • ベストアンサー率41% (426/1024)
回答No.1

HTMLのソースがなければ分かりません。CSSだけで間違いを探すのはかなり難しいです。

pyupyuo2
質問者

補足

そうなんですね、失礼しました。 テキストはサンプルのままいじってないので気にしないでください。 <!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 http-equiv="description" content=""> <meta http-equiv="keywords" content=""> <link rev="made" href="mailto:"> <link rel="start" href=""> <link rel="contents" href="index.html"> <link rel="prev" href=""> <link rel="next" href=""> <link rel="stylesheet" type="text/css" href="design.css" media="all"> </head> <body> <p class="menu"><img border="0" src="images/logo.gif" width="197" height="96" alt=""><img src="images/menu.gif" width="10" height="39" border="0"><a href="index.html"><img border="0" src="images/home.gif" width="60" height="39" alt=""></a><img src="images/menu.gif" width="10" height="39" border="0"><a href="recipe.html"><img border="0" src="images/recipe.gif" width="60" height="39" alt=""></a><img src="images/menu.gif" width="10" height="39" border="0"><a href="tech.html"><img border="0" src="images/tech.gif" width="60" height="39" alt=""></a><img src="images/menu.gif" width="10" height="39" border="0"><a href="tools.html"><img border="0" src="images/tools.gif" width="60" height="39" alt=""></a><img src="images/menu.gif" width="10" height="39" border="0"><a href="books.html"><img border="0" src="images/books.gif" width="60" height="39" alt=""></a><img src="images/menu.gif" width="10" height="39" border="0"><a href="about.html"><img border="0" src="images/about.gif" width="60" height="39" alt=""></a><img src="images/menu.gif" width="10" height="39" border="0"><a href="bbs.html"><img border="0" src="images/bbs.gif" width="60" height="39" alt=""></a><img src="images/menu.gif" width="10" height="39" border="0"><a href="mail.html"><img border="0" src="images/mail.gif" width="60" height="39" alt=""></a><img border="0" src="images/menu_right.gif" width="20" height="39" alt=""> </p> <div class="contents"> <div class="section"> <h2><img src="ecology_sub01b.gif" alt="エコロジーへの取り組み" width="154" height="17"></h2> <p> Computer Technology Groupsでは早くからエコロジーの研究に取り組んできました。自然エネルギーの活用もすすめており、二酸化炭素(CO2)の排出量を減らす努力もしています。専門家の招致、育成にも努め、来春には環境研究施設を設立する予定です。 </p> <p> 地域の自然環境の育成にも努めています。植樹、植林活動から、公園の整備なども行っています。また、社内裏手には広くて気持ちのいい芝生の丘があり、一般にも開放しています。昼休みなどには、憩いの場として賑わっています。 </p> <p> 自然エネルギーの活用もすすめており、二酸化炭素(CO2)の排出量を減らす努力もしています。専門家の招致、育成にも努め、来春には環境研究施設を設立する予定です。地域の自然環境の育成にも努めています。植樹、植林活動から、公園の整備なども行っています。また、社内裏手には広くて気持ちのいい芝生の丘があり、一般にも開放しています。昼休みなどには、憩いの場として賑わっています。 </p> </div> </div> <address> Copyright (C) <a href="mailto:admin@mail.address">Computer Technology Groups</a>. All rights reserved. </address> <div id="menu2"> <a href="cate01.htm">エコロジー</a><br> <a href="cate02.htm">コンピューター</a><br> <a href="cate03.htm">モバイル</a><br> <a href="cate04.htm">ショッピング</a><br> <a href="cate05.htm">お問い合わせ</a><Br> </div> </body> </html>

関連するQ&A

  • ブログのタイトル文字色について。

    fc2でブログを始めました。 色々検討して、公式テンプレートの「life」というものを選択しました。 ただ、タイトルの背景画像だけ変更しようと思い、色々苦労した結果、変更できました。 しかし、タイトルの文字色が灰色のため、今のままではタイトルがひどく見づらいのです。 そこでタイトルの文字色を変更しようとしましたが、どうにもそれに該当する部分が分かりません。 以下にスタイルシートを貼りますので、どなたかご教授下さい。 body { font-family: Verdana ,sans-serif,Osaka; background: #eee; background-image: url(http://templates.blog.fc2.com/template/life/bacck6.gif); background-position: 0 0; background-attachment: scroll; background-repeat: repeat; font-size: 83%; line-height: 1.6; margin:0; color:#232323; } a:link { color:#bbb; text-decoration: none; } a:active { color: #999; text-decoration: none } a:visited { color: #777; text-decoration: none } a:hover { color: #d00; text-decoration: underline; } /* h1 を大きくとって、背景画像を見せてます。 */ /* 出来る人は div 要素なんか使って、テンプレ弄った方がいろいろいいかも */ h1 { background: #070; /* 背景を差し込む場合は高さ 150px ぐらい推奨 */ background-image: url(http://blog-imgs-59.fc2.com/n/a/m/namakedaruma/201304221809488f4.jpg); background-position: 0 0; background-attachment: scroll; background-repeat: repeat; margin: 0; font-size: 150%; /* 文字の位置を変える場合、上下合わせて 6em 取るといいかも */ padding: 3em 3em; /* 位置を真ん中にしない場合は以下で文字位置設定 */ /* padding: 3em 0.7em 3em 0.7em; */ border-left: 1px solid #000; border-right: 1px solid #000; } h1 a:link { color: #fff; text-decoration: none; } /* h2 要素は現時点で、横向きカレンダーで被せてるんで擬似背景設定になってます */ h2 { background: #000; background-image: url(http://templates.blog.fc2.com/template/life/back2.gif); background-position: 0 0; background-attachment: scroll; background-repeat: repeat; margin: 0; padding: 0.5em; text-align: center; font-size: 100%; font-style: normal; border-left: 1px solid #000; border-right: 1px solid #000; color: #fff; border-top: 2px solid #000; border-bottom: 2px solid #000; } /* h2 要素に被る横カレンダー設定 */ .yokocal { position: absolute; left: 10%; top: 16em; border: 1px solid #000; background: #777; padding: 0.3em; text-align: center; margin: 0; font-size:75%; } /* 背景色透過で、h1 要素最下部に表示する場合や、横カレンダーを表示させない場合は、 以下の設定の方がしっくりきます。*/ /* 背景画像によって、文字色の変更 */ /* この場合は h2 要素が見えるようになります */ /* h2 要素の上下のパディング 0.5em が大きくて気になる場合は減らす */ /* 参考までに h2 要素の上下パディングを 0 にした場合、 以下で記述の right 属性の top のプロパティを 14.5em から 13.4em へ変更 */ /* .yokocal { position: absolute; left: 10%; top: 13em; padding: 0.3em; text-align: center; margin: 0; font-size:75%; } */ /* 横カレンダーの日付はリストを inline で横に並べてるので、不具合ある人もいるかも。*/ .yokocal li { color: #000; display: inline; margin: 0 0.1em; } .yokocal a{ font-weight: bold; } .yokocal a:link { color: #fff; text-decoration: underline; } .yokocal a:visited { color: #999; text-decoration: underline; } .yokocal a:hover { color: #f00; text-decoration: none; } /* レイアウト設定 */ /* レイアウト構成は left の中に right を左側に入れ込んでるという感じ。 そのために、left 属性では左に大きくパディングを取ってます。 ので、left でも実際は、右側に表示されることになります。*/ /* 記事表示部分 */ .left { margin: 0; margin-left:1px; padding: 0 0 0 18.7em; border: 1px solid #000; background: #fff; } /* メニュー部分 */ .right { background: #ffe; background-image: url(http://templates.blog.fc2.com/template/life/back3.gif); background-position: 0 0; background-attachment: scroll; background-repeat: repeat; width: 15.5em; border-right: 1px solid #000; border-left: 1px solid #000; border-bottom: 1px solid #000; position: absolute; padding: 1.7em 0.7em; top: 14.5em; left: 0; color: #232323; /* left 属性のボーダーを使うためその分の余白 */ margin-left: 1px; } .right p{ margin: 0.3em; font-size: 80%; } .right a:link { color:#333; text-decoration: none; } .right a:active { color: #999; text-decoration: none } .right a:visited { color: #666; text-decoration: none } .right a:hover { color: #d00; text-decoration: underline; } /* メニューの見出し*/ .right h3 { font-size: 80%; font-family: Verdana ,sans-serif,Osaka; font-weight: normal; color: #000; letter-spacing: 0.1em; margin: 1.7em 0 0 0; padding: 0.2em 0.2em 0.2em 0.7em; background: #ffd; bo

  • XHTML、CSSレイアウトでフッターを常に最下部に配置するには?

    フッターを最下部に表示したいのですが、#footerに position: fixed; bottom:0;を付け加えてもフッター だけ最下部に表示されコンテンツ部分がついてきません。 ヘイトに100%をつけくわえるのでしょうか? どうかご教授願います。 body { margin: 0; padding: 0; text-align:center; font-family:"MS Pゴシック", Osaka, "ヒラギノ角ゴ Pro W3"; font-size:1em; background-color:#CCCCCC; } ol,ul,li { margin: 0; padding: 0; } li { list-style:none; } h1,h2,h3,p { margin: 0; padding: 0; } #container { margin: 0 auto; text-align: left; width: 740px; height: 100%; background-color:#FFFFFF; } #header { width:740px; height:80px; margin:0; padding:0; background-color:#FFFFFF; background-image:url(img/nine_rogo.gif); background-repeat:no-repeat; background-position:left center; } #contents { width:740px; height:100%; margin:0; padding:0; background-color:#FFFFFF; } #menu { float:left; width:140px; height: auto; margin:0; padding:0; background-color:#FFFFFF; color:#000000; } #main { float:right; width:580px; height:auto; margin:0; padding:0 0 0 10px; background-color:#FFFFFF; color:#000000 } #footer { clear:both; width:740px; height:auto; background-color:#FFFFFF; color:#000000; font-size:1em; padding:0.3em 0; text-align:center; }

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

    ヘッダー・メイン・サイドバー(左右)・フッターの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
  • 背景の色がコンテンツ部分にも表示されてしまいます

    サイトに背景色をつけて、コンテンツ部分は白にしたのですが、どうしても背景色が表示されてしまいます。今はbody以外の各divの背景を白にしていますが、contentsの右下が背景色が表示されてしまします。 お手数ですが、ご指摘頂けると幸いです。よろしくお願いいたします。 <html> <body> <div id="wrapper"> <div id="header"></div> <div id="contents"> <div id="banner"></div> <div id="navi"> <h2><a href="../service/index.html"><em>あああ</em></a></h2> 中略 </div> <div id="bread"><a href="index.html">トップページ</a> &gt; あああ</div> <div id="main"> <p>あああ</p> </div> <div id="sidenavi"> <h3>あああ</h3> <p>あああ</p> </div> <div id="pagetop"><a href="#"></a></div> <div id="footer">Copyright (c) 2009 All Right Reserved </div> </div> </body> </html> <css> body { text-align: center; margin: 0px; padding: 0px; background: #FFCCFF; } #wrapper { text-align: left; margin: 0px auto; padding: 0px; height: 800px; width: 850px; background: #FFFFFF; } #header { margin: 0px; padding: 0px; height: auto; width: 850px; background: #FFFFFF; } #contents #banner { background: url(image/banner.jpg) no-repeat; margin: 0px; padding: 0px; height: 304px; width: 850px; } #contents #navi { background: url(image/menu.jpg) no-repeat; margin: 0px; padding: 0px; height: 61px; width: 850px; } #contents #navi2 { background: url(image/menu2.jpg) no-repeat; margin: 0px; padding: 0px; height: 61px; width: 850px; } #navi h2 { font-size: 12px; margin: 0px; padding: 0px; float: left; } #navi em { visibility: hidden; } #navi2 h2 { font-size: 12px; margin: 0px; padding: 0px; float: left; } #navi2 em { visibility: hidden; } #contents { margin: 0px; padding: 0px; height: 500px; width: 850px; background: #FFFFFF; } #contents #sidenavi p { font-size: 95%; line-height: 1.1em; margin-right: 5px; margin-left: 5px; } #sidenavi h3 { font-size: 105%; font-weight: bold; border-left: 7px solid #FF3366; padding-left: 5px; background: #FFCC33; margin: 0px; padding-top: 5px; padding-bottom: 5px; } #navi a { margin: 0px; padding: 0px; height: 61px; width: 169.5px; display: block; text-decoration: none; } #navi2 a { margin: 0px; padding: 0px; height: 61px; width: 170px; display: block; text-decoration: none; } #contents #main { margin: 10px 0px 0px; padding: 0px 10px 10px; height: auto; width: 610px; float: left; font-family: "MS Pゴシック", Osaka, "ヒラギノ角ゴ Pro W3", "メイリオ"; background: #FFFFFF; } #contents #pagetop { clear: both; background: #FFFFFF; margin: 0px; padding: 0px; } #contents #sidenavi { margin: 10px 5px 0px 0px; padding: 0px; float: right; width: 200px; border: 1px dashed #FF3399; background: #FFFFFF; } #footer { font-size: 90%; color: #FF3366; text-align: center; margin: 0px; padding: 10px 0px 0px; clear: both; border-top: 1px dotted #333333; border-right-color: #333333; border-bottom-color: #333333; border-left-color: #333333; background: #FFFFFF; } #main p { font: bold 120% "MS Pゴシック", Osaka, "ヒラギノ角ゴ Pro W3"; color: #FF3399; padding: 0px; margin-top: 5px; margin-bottom: 5px; } #pagetop img { text-align: center; padding-top: 10px; margin: 0px; padding-bottom: 10px; padding-left: 5px; } .p1 { font-size: 130px; color: #FF3366; padding: 10px; width: 590px; border: 2px dashed #FF3399; background: #FFCCFF; margin: 10px; text-align: center; } #main img { margin: 0px; padding: 0px 0px 10px; } #contents #bread { margin: 5px 0px 0px; padding: 5px 5px 0px 10px; font-size: 100%; width: 830px; }

  • CSS backgroundが反映されません

    CSS初心者です。 CSSレイアウトで問題にぶつかりました。 下記CSSをIE6で見るとbodyに書いた 「background-image:url(images/flower.png); 」が反映されません。 IE10では反映されました。 いったい何故でしょうか。。。 調べてみたのですがいまいち分かりませんでした。 よろしくお願いいたします。 ★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★ * { margin:0; padding:0; } body { background-image:url(images/flower.png); background-repeat:no-repeat; background-position:bottom; background-attachment:fixed; background: rgb(#00000); color: rgb(76, 76, 76); } body{ text-align:center; } div#container { background-image:url(images/sora.jpg); background-repeat:no-repeat; box-shadow: 10px 10px 10px rgba(0,0,0,0.4); #000; box-shadow: 10px 10px 10px rgba(0,0,0,0.4); #000; } div#container{ width: 770px; margin: 0 auto; text-align: left; border: 3px solid rgb(228, 225, 219); } .photo{ margin: 0px; padding: 0px; left: 600px; top: 970px; width: 141px; position: absolute; } .photo2{ margin: 0px; padding: 0px; left: 400px; top: 970px; width: 141px; position: absolute; } p { line-height: 2em; font-size: 0.8em; } .p1{ font-weight: bold; letter-spacing: 0.1em; } .h1{ text-align: center; } h1 span { display:none; } h2 span { display:none; } h3 { line-height: 1.2em; padding-top: 2.4em; padding-bottom: 1em; font-size: 1em; font-weight: bold; } h3 { background-image:url(images/h3.png); background-repeat:no-repeat; background-position:0px 35px; padding-right: 40px; padding-left: 30px; } h2 { line-height: 1.3em; padding-top: 1em; padding-bottom: 1em; font-size: 1em; font-weight: bold; } a{ color:#0000ff; font-style:normal; text-decoration:underline; } a:link { color: rgb(90, 120, 255); font-style:normal; text-decoration:underline; } a:visited { color: rgb(165, 188, 255); text-decoration:underline; } a:hover { color:#ff0000; font-style:normal; text-decoration:underline; } acronym { border-bottom-color: currentColor; border-bottom-width: medium; border-bottom-style: none; } #intro { padding: 0px 79px 0px 86px; } #participation p { padding-right: 40px; padding-left: 10px; } #intro { padding-top: 50px; } #preamble p { padding-right: 40px; padding-left: 15px; } #explanation p { padding-right: 40px; padding-left: 15px; } #preamble { padding-bottom: 20pt; border-bottom-color: rgb(228, 225, 219); border-bottom-width: 3px; border-bottom-style: ridge; } #explanation { padding-bottom: 20pt; border-bottom-color: rgb(228, 225, 219); border-bottom-width: 3px; border-bottom-style: ridge; } #participation { padding-bottom: 20pt; border-bottom-color: rgb(228, 225, 219); border-bottom-width: 3px; border-bottom-style: ridge; } #benefits { padding-bottom: 20pt; border-bottom-color: rgb(228, 225, 219); border-bottom-width: 3px; border-bottom-style: ridge; } #requirements { padding-bottom: 20pt; border-bottom-color: rgb(228, 225, 219); border-bottom-width: 3px; border-bottom-style: ridge; } #quickSummary p{ padding-right: 40px; padding-left: 10px; } #footer { text-align: center; line-height: 1.5em; padding-top: 10px; padding-bottom: 40px; font-size: 0.9em; } #footer a:link { color: rgb(133, 126, 112); } #footer a:visited { color: rgb(133, 126, 112); } #footer a:hover { color: rgb(133, 126, 112); } #footer a:active { color: rgb(133, 126, 112); }

    • ベストアンサー
    • CSS
  • CSS IDごとのCLASS指定

    以下のようなCSSがあった場合に、それぞれのIDに同じ名前で中身の違うCLASSを指定する事は出来るのでしょうか? #main{ margin:0; padding:0; background: transparent; float : left; font-size : 0.8em; } #menu{ margin:0; padding:0; width:140px; float : left; font-size : 0.8em; background :url('img/back.gif') no-repeat left top; color:#17F600; } #mainにはこれ、 .txt { font-size : 1em; line-height : 120%; margin:0 0 5px 380px; padding:0 0 0 30px; text-align : left; color:#69788A; } #menuにはこれ .txt{ font-size : 1em; padding:0 0 0 10px; margin:5px 30px 5px 0; text-align : left; color:#69788A; border-bottom:1px solid #CFDEEF; } といったかんじなのですが…

    • ベストアンサー
    • HTML
  • CSSレイアウト マージンについて

    下記のタグにてメインスペースを両側10pxにしたいのですが、うまくいきません。 下記のようなレイアウトにてうまくmarginなどを行う場合は どのようにしたらよろしいでしょうか? なお簡単にタグを記載してくださいますと幸いです。 CSS body {    margin:3em; color:#339900; background:#ffffff; } h1 { padding:0.1em; text-align:center; leter-specing:1em; border-top: 1px solid #000000; border-bottom: 1px solid #000000; } .mainspace { background:#aaaaaa; width:480px;       margin-right:10px;       margin-left:10px ; position:absolute; left:260px; } .leftmenu { background:#bbbbbb; width:200px; position:absolute; left:50px; } .rightmenu { background:#cccccc; width:200px; position:absolute; right:50px; } HTML <h1>メインタイトル</h1> <div class="mainspace"> <h2>サブタイトル</h2> <p> ただいまテスト中です。<br> ただいまテスト中です。<br> ただいまテスト中です。<br> ただいまテスト中です。<br> ただいまテスト中です。<br> </p> </div> <div class="leftmenu"> <ul> <li>メニュー</li> <li>メニュー</li> <li>メニュー</li> <li>メニュー</li> <li>メニュー</li> </ul> </div> <div class="rightmenu"> <ul> <li>メニュー</li> <li>メニュー</li> <li>メニュー</li> <li>メニュー</li> <li>メニュー</li> </ul> </div>

    • ベストアンサー
    • HTML
  • CSSでテーブルを使わずにレイアウト

    以下のソースでなんとかレイアウトできたのですが 左よせではなくセンターよせにしたいのですがどのように記述すればよいでしょうか?CSSの対応していないブラウザの場合にメニューを下部メニューにしたいため p.menu は下部に記述しています。 -- css -- body { width:700px; margin:0px; font-size:12px; color:#ffffff; } p.head { height:15px; margin:0px auto; background-color:#0000ff; } .text { width:500px; text-align:left; margin:0px 0px 0px auto; background-color:#aa0000; } p.menu { width:200px; background-color:#dddddd; position:absolute; left:0px; top:15px; } -- html -- <body> <p class="head"> タイトル </p> <div class="text"> あいうえおかきくけこ </div> <p class="menu"> <a href="">menu1</a> </p> </body>

    • ベストアンサー
    • HTML
  • xml宣言をするとIE6で右サイドがカラム落ちしてしまいます。

    http://www.infofx.jp/ 上記のサイトをアップしたばかりなのですが、 xml宣言をすると右サイドがカラム落ちしてしまいます。 SEOを考えてxml宣言は外したくないのですが、良い方法があればどなたか教えて頂けますでしょうか?宜しくお願い致します。ちなみに以下がcssです。 @charset "shift_jis"; body { color: #666666; margin: 0px; padding: 0px; text-align: center; font: 75%/1.8 "メイリオ", "MS Pゴシック", Osaka, "ヒラギノ角ゴ Pro W3"; background: #e9f3ff url(images/kabe.gif) repeat-x top; } h1,h2,h3,p,ul,li{ margin: 0px; padding: 0px; } ul{ list-style-type: none; } img { border: none; vertical-align: bottom; } #container { background-image: url(images/container_bg.gif); width: 896px; text-align: left; background-repeat: repeat-y; background-position: center; margin-top: 0px; margin-right: auto; margin-left: auto; padding-right: 4px; padding-left: 4px; } *.float { float: left; margin-right: 1em; } /*コンテンツ ----------------------------------------------------------------*/ #contents { float: left; width: 706px; } /*メイン ----------------------------------------------------------------*/ #main { float: right; width: 498px; margin-right: 9px; margin-left: 9px; display: inline; } #main h2 { background-image: url(images/midashi_bg.gif); background-repeat: no-repeat; background-position: left top; font-size: 100%; padding-left: 10px; height: 30px; padding-top: 4px; padding-right: 5px; color: #FFFFFF; letter-spacing: 0.5em; } #main p { padding-right: 10px; padding-left: 10px; padding-bottom: 15px; } /*右側 ----------------------------------------------------------------*/ #side { float: right; width: 181px ; display: inline; margin-right: 4px; margin-left: 5px; font-size: 90%; text-align:center; } #side p { margin-bottom: 10px; color: #666666; } .side-table { border: 1px solid #cccccc; padding: 2px; line-height: 2; text-align: center; background: #f7faff; } .side-table h3 { background-color: #ffffff; padding-top: 3px; padding-bottom: 2px; color: #666666; text-align: center; font-weight: normal; font-size: 100%; letter-spacing: 0.5em; margin-bottom: 10px; border: 1px solid #cccccc; } /*メニュー他 ----------------------------------------------------------------*/ #sub { float: left; width: 181px; display: inline; margin-right: 5px; margin-left: 4px; color: #666666; } #sub li { background-image: url(images/menu_arrow.gif); background-repeat: no-repeat; background-position: left center; padding-left: 25px; } #sub ul { margin-bottom: 20px; } #sub li a { color: #666666; text-decoration: none; display: block; width: 100%; } #sub li a:hover { color: #FF3B33; } .arrow-last { background-image: url(images/menu_arrow_last.gif) !important; background-repeat: no-repeat; background-position: left center; } .menu-midashi { border: 1px solid #cccccc; background-image: none !important; background-color: #ffffff; color: #666666; padding-top: 3px; padding-bottom: 2px; } /*clearfix ------------------------------------------------------------------*/ #container:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; } #container { display: inline-block; } /* Hides from IE-mac \*/ *html #container { height: 1%; } #container { display: block; } /* End hide from IE-mac */*/

    • 締切済み
    • XML
  • CSSファイル内のバグの原因

    あるサイトのリニューアル中リンクバナーに指定したレイアウト用のCSSが急に機能しなくなり、原因がわかりません。同じCSSファイルを使用したページで共通したバグがj生じるのでCSSファイルが原因と思いチェックしたのですが、自分では原因を突き止められずにいます。サイトは、 http://www.vesta.dti.ne.jp にアップロードしています。問題のCSSファイルの対象と思われるソースをコピーしました。宜しくお願いいたします。バグの原因になる要素でご存知のものがあれば教えて下さい。 body{font-family: Arial,sans-serif;color: #333333;line-height: 1.166;margin: 0px;padding: 0px;background: #cccccc;background-color: #cccccc;} a:link, a:visited{color: #005FA9;text-decoration: none;} a:hover{text-decoration: underline;} h1{ font: bold 120% Arial,sans-serif;color: #334d55;margin: 0px; padding: 0px;} h2{font: bold 120% Arial,sans-serif;color: #006699;margin: 0px; padding: 0px;} h3{font: bold 100% Arial,sans-serif;color: #334d55;margin: 0px;padding: 0px;} h4{ font: 100% Arial,sans-serif;color: #333333;margin: 0px;padding: 0px;} h5{font: 100% Arial,sans-serif; color: #334d55;margin: 0px;padding: 0px;} form {margin: 0;padding: 0;}label{ font: bold 1em Arial,sans-serif;color: #334d55;}input{font-family: Arial,sans-serif;} #pagecell1{position:absolute;top: 112px;left: 2%;right:2%;width:85.6%;background-color: #ffffff;} #tl {position:absolute;top: -1px;left: -1px;margin: 0px;padding: 0px;z-index: 100;} #tr {position:absolute;top: -1px;right: -1px;margin: 0px;padding: 0px;z-index: 100;} #masthead{position: absolute;top: 0px;left: 2%;right: 2%;width:85.6%;} #pageNav{float: right;width:190px;padding: 0px;background-color: #f5f7f7;border-left: 1px solid #cccccc;border-bottom: 1px solid #cccccc;font: small Verdana,sans-serif;} #content{padding: 0px 10px 0px 0px;margin:0px 190px 0px 0px; border-right: 1px solid #ccd2d2;} #siteName{margin: 0px;padding: 16px 0px 8px 0px;color: #ffffff;font-weight: normal;} #utility{font: 75% Verdana,sans-serif;position: absolute;top: 16px;right: 0px;color: #919999;} #utility a{color: #ffffff;} #utility a:hover{text-decoration: underline;} #pageName{padding: 0px 0px 14px 10px;margin: 0px;border-bottom:1px solid #ccd2d2;} #pageName h2{font: bold 165% "MS P明朝", "細明朝体", "ヒラギノ明朝 Pro W3";color: #336633;margin:0px;padding: 0px;} #pageName img{position: absolute;top: 0px;right: 6px;padding: 0px;margin: 0px;} #globalNav{position: relative;width: 100%;min-width: 640px;height: 32px;color: #cccccc;padding: 0px;margin: 0px;background-image:url(../commonimg/glbnav_background.gif);} #globalNav img{margin-bottom: -4px;} #gnl {position: absolute;top: 0px;left:0px;} #gnr {position: absolute;top: 0px;right:0px;} #globalLink{position: absolute;top: 6px;height: 22px;min-width: 640px;padding: 0px;margin: 0px;left: 10px;z-index: 100;} a.glink, a.glink:visited{font-size: small;color: #666666;font-weight: bold;margin: 0px;padding: 2px 5px 4px 5px;border-right: 1px solid #8FB8BC;} a.glink:hover{background-image:url(../commonimg/glblnav_selected.gif);text-decoration: none;} .skipLinks {display: none;} .subglobalNav{position: absolute;top: 84px;left: 0px;/*width: 100%;*/min-width: 640px;height: 20px;padding: 0px 0px 0px 10px;visibility: hidden;color: #ffffff;} .subglobalNav a:link, .subglobalNav a:visited{ font-size: 80%;color: #ffffcc;} .subglobalNav a:hover{color: #ffffcc;} #search{position: absolute;top: 5px;right: 10px;z-index: 101;} #search input{font-size: 70%;margin: 0px 0px 0px 10px; } #search a:link, #search a:visited {font-size: 80%;font-weight: bold;} #search a:hover{margin: 0px;}

専門家に質問してみよう