CSS左右の背景が異なる設定方法

このQ&Aのポイント
  • CSSを使用して、ウェブページの左右の背景を異なるデザインにする方法について説明します。
  • 具体的な背景設定の方法や注意点について解説します。
  • 特定の要素に対して背景を適用する方法や、背景が途中で切れる不具合の改善策なども紹介します。
回答を見る
  • ベストアンサー

css 左右の背景が異なる設定方法

下記の1ページだけ、右背景が途中で切れてしまう不具合が出てしまいました。 このような感じです。 http://marimekko2525.web.fc2.com/ 設定方法は下記のサイトを参考にして作りました。 http://www.webopixel.net/javascript/517.html スライドショーが入っている”<div id="cont">”部分に原因があると思うのですが、 改善策が分かりません。。。 どなたか分かる方いらっしゃいましたらアドバイスをお願いします。 cssソース /*====↓reset.css↓====*/ body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,form,fieldset,legend,input,p,blockquote,th,td { margin:0;padding:0; } img{ border: 0; } /*====↓base.css↓====*/ #cont { width: 610px; height: 100%; position: relative; margin: 50px auto; z-index: 70; overflow: hidden; } #works_deta{ clear:both; margin-top:100px; margin-bottom:10px; padding:20px; background-color:#333535; } #works_deta h4, #works_deta_right h5{ margin-bottom:10px; } #works_deta_left{ float:left; } #works_deta_right{ float:right; width:390px; } #works_deta_right p{ color:#ffffff; font-size: 85%; line-height:1.8em; } hr#works_deta_right{ clear:both; } p.works_deta{ color:#ffffff; font-size: 85%; line-height:1.8em; text-align:right; clear:both; } #works_deta_right img.back_to_list{ float: right; } /*====↓iview.css↓====*/ /* The slider */ .iviewSlider { overflow: hidden; } /* The timer in the Slider */ #iview-timer { position: absolute; z-index: 100; border-radius: 5px; cursor: pointer; } #iview-timer div { border-radius: 3px; } /* The Preloader in the Slider */ #iview-preloader { position: absolute; z-index: 1000; -webkit-border-radius: 3px; -moz-border-radius: 3px; border-radius: 3px; border: #000 1px solid; padding: 1px; width: 100px; height: 3px; } #iview-preloader div { float: left; -webkit-border-radius: 2px; -moz-border-radius: 2px; border-radius: 2px; height: 3px; background: #000; width: 0px; } /* The strips and boxes in the Slider */ .iview-strip { display:block; position:absolute; z-index:5; } .iview-block { display:block; position:absolute; z-index:5; } /* Direction nav styles (e.g. Next & Prev) */ .iview-directionNav a { position:absolute; top:45%; z-index:9; cursor:pointer; } .iview-prevNav { left:0px; } .iview-nextNav { right:0px; } /* Control nav styles (e.g. 1,2,3...) */ .iview-controlNav { position:absolute; z-index:9; } .iview-controlNav a { z-index:9; cursor:pointer; } .iview-controlNav a.active { font-weight:bold; } .iview-controlNav .iview-items ul { list-style: none; } .iview-controlNav .iview-items ul li { display: inline; position: relative; } .iview-controlNav .iview-tooltip { position: absolute; } /* The captions in the Slider */ .iview-caption { position:absolute; z-index:4; overflow: hidden; cursor: default; } /*====↓style.css↓====*/ .container { display: block; width: 600px; margin: 0px auto; } #iview { display: block; width: 600px; background: #000; background: rgba(0, 0, 0, 0.7); padding: 5px; border-radius: 5px; position: relative; margin: 10px auto; } #iview .iviewSlider{ display: block; width: 600px; height: 360px; overflow: hidden; border-radius: 4px 4px 0px 0px; } .iview-controlNav { position: static; height: 45px; text-align: center; border-radius: 0px 0px 4px 4px; } .iview-controlNav .iview-items { display: block; padding: 0px 20px; } .iview-controlNav a img { height: 60px; border: #000 1px solid; margin: 20px 10px 20px 0px; border-radius: 2px; } .iview-controlNav a.active img { border-color: #999; } #iview-preloader { border: #666 1px solid; width: 150px } #iview-preloader div { background: #666; }

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

  • ベストアンサー
回答No.3

No1です。 どうやら#iviewの高さもうまく取れてないみたいですので、css の #iview に高さを指定することはできませんか?例えば height:405px; とかでどうでしょう。

marimekko2525
質問者

お礼

高さを指定したらぶじ反映されました。 お忙しいところ時間を割いていただき 本当にありがとうございました。

その他の回答 (2)

回答No.2

no1です。 参考ソースにalertを入れたままでしたので使うときには取ってください。

回答No.1

スライドショーが表示されるよりも先にwrapperの高さを読んじゃってるので $(window).load(function() { var h = $('#article').height(); alert(h); if( $('body').height() < h ) { $('#left-bg').height(h); $('#wrapper').height(h); } }); としてみてください。

marimekko2525
質問者

補足

アドバイスありがとうございます。 ソースを差し替えてみましたが、まだ変わらない状態です。

関連するQ&A

  • CSSのdivで、ページ全体をセンタリング出来ない

    質問させて頂きます。 <style type="text/css"> #contena { margin-right: 10px; margin-left: 10px; text-align: center; height: 900px; width: 950px; } </style></head> というように、全体をdivで囲んだにもかかわらず、何故かセンタリング出来ません。 最も簡単に、このページをセンタリングするには、どうすればよいでしょうか? ホームページビルダーで「どこでも配置モード」で作ったものを、dreamweaverで作り直す場合に該当します。 下記にHTMLを記載しておきます。 <!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"> <meta http-equiv="Content-Style-Type" content="text/css"> <meta name="IBM:HPB-Input-Mode" content="mode/flm; pagewidth=750; pageheight=900"> <meta name="GENERATOR" content="IBM WebSphere Studio Homepage Builder Version 14.0.8.0 for Windows"> <title>タイトル</title> <style type="text/css"> #contena { margin-right: 10px; margin-left: 10px; text-align: center; height: 900px; width: 950px; } </style></head> <body background="blue_p7b.gif"> <div id="contena"> <div style="top : 0px;left : 20px; position : absolute; z-index : 20; " id="Layer22"><img src="anim.gif" width="373" height="93" border="0" alt="ようこそ"></div> <div style="top : 18px;left : 575px; position : absolute; z-index : 2; " id="Layer4"><a href="http://www.dodgeball.or.jp/"><img src="jdba1.gif" border="0" width="106" height="30"></a></div> <div style="top : 60px;left : 143px; position : absolute; z-index : 1; " id="Layer1"><img src="logo111.gif" width="488" height="69" border="0" alt="リンク"></div> <div style="top : 219px;left : 317px; position : absolute; z-index : 27; width : 580px; height : 51px; " id="Layer28"> <p><font color="#0000ff" size="+2">コンテンツ</font></p> </div> <div style="top : 161px;left : 647px; position : absolute; z-index : 22; " id="Layer23"></div> <div style="top : 255px;left : 284px; position : absolute; z-index : 28; " id="Layer2"><img src="frendlyindx.gif" width="546" height="410" border="0"></div> <div style="top : 216px;left : 652px; position : absolute; z-index : 23; " id="Layer24"></div> <div style="top : 304px;left : 50px; position : absolute; z-index : 26; " id="Layer27"></div> <div style="top : 754px;left : 47px; position : absolute; z-index : 19; width : 707px; height : 154px; " id="Layer21"><iframe frameborder="1" src="saishijoho.html" width="709" height="150" scrolling="AUTO"></iframe></div> <div style="top : 953px;left : 40px; position : absolute; z-index : 7; " id="Layer9"><a href="taikaikekka.html"><img src="button41.gif" width="57" height="54" border="0" alt=" "></a></div> <div style="top : 659px;left : 48px; position : absolute; z-index : 6; " id="Layer8"><img src="logo1.gif" width="194" height="65" border="0" alt="最新情報 "></div> <div style="top : 1020px;left : 34px; position : absolute; z-index : 12; </div> </body> </html> 詳しい方がいましたら、よろしくお願いします。

  • z-indexを使用した枠の設定について

    z-indexを使用して画像の枠を丸くしたいと思い、 参考URL→http://www.htmq.com/style/z-index.shtml を参考にしたのですが出来ません。 div.imageboxで作った角丸の枠を画像の上から重ねて画像を角丸にしたいのですが、どうすれば良いのでしょうか。 ちなみにcssやhtmlで画像を背景画像として扱うという方法は私事情で出来ません。申し訳ありません。この方法ならば簡単にできるのですが・・・ 下はそのソースです。お願いいたします。 <!-- css --> div.imagebox{       //枠の設定 height:150px; width:150px; display: inline-block; -webkit-border-radius: 10px; -moz-border-radius: 10px; border-radius: 10px; position:relative; z-index:2; }img.imagebox{      //画像のz-index設定 position:relative; z-index:1; } <!-- html --> <div class="imagebox"> <img src="画像" width="150" height="150" border="0" class="imagebox"> </div>

  • WordPress レスポンシブテーマのCSS

    http://atsumare.wp.xdomain.jp/ 上記のURLでWordPressを使ってレスポンシブデザインの自作テーマを構築中です。 クラス「glay」でくくったボックスがスマホだと本文に食い込んでしまって困っています。 下記のものがスマホ用スタイルシートです。 /**************************************** スマホ用 ****************************************/ @media screen and (max-width:640px){ #main-1 { max-width: 100%; width: 100%; } /* ページヘッダー */ body.home header { background-size:cover; background-image:url("http://atsumare.wp.xdomain.jp/wp-content/uploads/2019/09/bg.jpg"); width:100%; height:200px; } header img{ background-size:cover; display:inline-block; margin-left:auto; margin-right:auto; } h1 { position:absolute; top:0; left:0; margin-left:50px; margin-top:100px; color:#fff; font-size:24pt; } header img { background-size:cover; /* width:640px; height:200px; */ } .right-dw { display:inline-block; position:relative; width:100%; float:left; } header nav { display: none; } /* コンテンツエリア */ article { width:100%; display:block; padding-left: 5px; padding-right: 5px; box-sizing: border-box; } img { max-width:100%; height:auto; margin: 5px 5px 5px 5px; float:left; background-size:cover; } .right-dw { clear:both; display:block; position:relative; width:100%; height:auto; float:left; } .glay { border:dotted 2px #696969; display:block; color:#696969; padding:2px; margin:15px 15px 15px 15px; position:absolute; } /* フッターエリア */ footer { max-width:100%; width:500px; display:block; text-align:center; margin-left:auto; margin-right:auto; } .footer { width:130px; display:inline-block; text-align:left; color: #000; font-size: 10pt; margin-left:auto; margin-right:auto; } small { font-size:10pt; } } どなたかご教示ください。

    • 締切済み
    • CSS
  • CSSについて 入力フォームの上下揃い

    CSSについて 入力フォームの上下揃い sample.css @CHARSET "windows-31j"; html,body,div,span,h1,h2,h3,h4,h5,h6{margin:0; padding:0; font-size:100%} html { height:100%; } body { height:100%; } body > #container { height: auto; z-index:0; } #container{ width:780px; margin-top:auto; margin-left:auto; margin-right:auto; margin-bottom:auto; position:relative; min-height:100%; border:1px solid #999; } #header{ margin: 0; padding: 0px 0px 0px 0px; width: 100%; height: 100px; background-color:#4682B4; z-index:1; } #main{ padding:auto; width:100%; backgruond-color:#87CEEB; z-index:1; } #footer{ position:absolute; bottom:0px; width: 100%; height: 100px; background-color:#4682B4; z-index:1; } index.html <div id="container"> <div id="header"></div> <div id="main"> <div class="vartical-align"> <form action=""> <input type="text" name="id"> <input type="password" name="pas"> </form> </div> </div> <div id="footer"></div> </div> 上記の用なCSSにて入力フォーム等を、id=main内にて上下中央揃えにしたいのですが どうした良いでしょう?

  • 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;}

  • 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;}

  • CSSの書き方について

    Jquery のポップアッププラグインであるPopboxを使おうとしています。 http://gristmill.github.io/jquery-popbox/ 実装は出来たのですが、下記の改造で戸惑っています。 ●デフォルトでは、クリックしたボタンから吹き出しの形で、ボタンより下にポップアップが表示されます。 ●当方の希望 クリックしたボタンの場所にかかわらず、スマートフォンの表示枠の一番上から表示させたいです。 CSSのどこを弄ると当方の希望の状況になるでしょうか? よろしくお願いいたします。 <style> .popbox { margin:0px auto; text-align:center; position:relative; } .collapse { position:static; } .open { background:#DDD; border:solid 1px #FFF; border-radius:5px; box-shadow: 0px 0px 5px #CCC; background:-webkit-gradient(linear,left top,left bottom,from(#f4f4f4),to(#e8e8e8)); background:-moz-linear-gradient(top,#f4f4f4,#e8e8e8); background:linear-gradient(top,#f4f4f4,#e8e8e8); padding:8px; } .box { width:280px; display:block; display:none; background:#FFF; border:solid 1px #BBBBBB; border-radius:5px; box-shadow:0px 0px 15px #999; position:absolute; } .box a.close { color:red; font-size:12px; font-family:arial; text-decoration:underline; } .arrow { width: 0; height: 0; border-left: 11px solid transparent; border-right: 11px solid transparent; border-bottom: 11px solid #FFF; position:absolute; left:1px; top:-10px; z-index:1001; } .arrow-border { width: 0; height: 0; border-left: 11px solid transparent; border-right: 11px solid transparent; border-bottom: 11px solid #BBBBBB; position:absolute; top:-12px; z-index:1000; } </style> <script type='text/javascript' charset='utf-8'> $(document).ready(function(){ $('.popbox').popbox(); }); </script> <h1>PopBox</h1> <div class='popbox'> <a class='open' href='#'> <img src='images/plus.png' style='width:14px;position:relative;'> Click Here! </a> <div class='collapse'> <div class='box'> <div class='arrow'></div> <div class='arrow-border'></div> 表示内容 </div> </div> </div>

    • ベストアンサー
    • CSS
  • a:hover 時にテキストが表示されません。

    コード初心者です。 コピペしたものを若干数字を変えて使用しようとしましたが、テキストが表示されません。他の解説をみましたが、自分との違いがよく分からないため質問させていただきました。 以下htmlとcssを記載しますので、どなたかご教授いただけないでしょうか・・・・。 html <a href="#" class="button"> <section id="news"> <h2>お知らせ</h2> <p> 9月10日㈭ 遊びに来てね!! </p> </section> </a> css #news{ width: 100%; height: 180px; margin: 0px auto 50px; border-radius: 10px; background-color: rgb(204, 160, 160); } .button{ position: relative; display: block; width: 90%; margin: 0 auto; transition: .3s; color: rgb(41, 35, 35); } .button:hover{ color: aliceblue; } .button::before { position: absolute; width: 100%; height: 180px; border-radius: 10px; top: 0; right: 0; bottom: 0; left: 0; z-index: 1; content: ''; background: rgb(37, 59, 26); transform-origin: right top; transform: scale(0, 1); transition: transform .2s; } .button:hover::before { transform-origin: left top; transform: scale(1, 1); color: ghostwhite; } 宜しくお願い致します!!!!

    • ベストアンサー
    • CSS
  • CSS アクティブタブの仕組み

    CSS アクティブタブの仕組み 閲覧ありがとうございます。説明下手ですがお付き合い宜しくお願い致します CSS勉強も兼ねて擬似フレームのサイトを作っているCSS初心者です 解らないことは本やリファレンスサイトで調べ、忘れた時の為にコメントを書きこみ少しずつですが理解しながらサイトを作っています。 現在テンプレートサイト様が配布されている http://10prs.com/material/samples/cdp/mono-vivid/index.html を参考にメニュータブごとに背景色を変え、アクティブになったタブの背景色もタブと同じ色にしようと考察してます。 タブがアクティブになった時にメニューとメイン部分の境界のボーダーが消えるのですが、この仕組みがいまいちよく解りません。 恥ずかしながらアクティブになった時にボーダーが消える部分の記述があるのがどこにあるのか発見できずにいます。 無知なのに無謀な試みと思われるでしょうが御教示頂けないでしょうか、宜しくお願い致します ■以下テンプレートのCSSを抜粋 /* 各#ID&.class */ div#PAGETOP { height: 100%; overflow: auto; } div#HEADER { position: fixed !important; position: absolute; top: 0; left: 0; width: 100%; height: 70px; color: #fff; background: #000; } ul#PAN { display: none; } div#MENU { position: fixed !important; position: absolute; top: 80px; left: 30px; width: 130px; } div#MENU h2 { display: none; } div#MENU ul { margin-top: 20px; margin-left: 0; list-style: none; position: absolute; z-index: 100; height: 100%; } div#MENU ul li a { margin: 5px 0 5px 10px; padding: 5px 0; border: 1px solid; display: block; width: 119px; color: #333; background: #f1f1f1; font-family: 'Book Antiqua', 'MS P明朝', serif; font-size: 116%; text-align: center; text-decoration: none; } div#MENU ul li a:hover { margin-left: 0 !important; width: 129px !important; } li.menu-on a, li.menu-on a:link, li.menu-on a:visited { margin-left: 0 !important; border-right: 1px solid #fff !important; width: 129px !important; background: #fff !important; } div#KIZI { margin-left: 160px; padding: 80px 50px 30px 50px; border-left: 1px solid #333; background: #fff; } ul.modori { display: none; } div#FOOTER { position: fixed !important; position: absolute; bottom: 0; left: 0; width: 100%; height: 22px; color: #fff; background: #000; } div#FOOTER h2, div#FOOTER ul.modori { display: none; } div#FOOTER ul { text-align: center; } div#FOOTER ul li { display: inline; }

    • ベストアンサー
    • HTML
  • CSSで、指定されていない空白が開く

    ヘッダーのロゴとその下のナビゲーションの間に、勝手に空白が空きます。 margin: 0;と設定しても空白が空きます。 section#header { width:80%; height: 63px; margin-right: auto; margin-left: auto; } img.LOGO { width: 700px; height: 63px; float: left; } p.intro { color: #383838; float: right; font-size: 120%; } section#links { font-size: 130%; width: 90%; height: 40px; margin-bottom: 40px; margin-right: auto; margin-left : auto; } nav ul li { display: block; float: left; width: 18%; height: 40px; margin-left: 1px; margin-right: 1px; border-left: #000000 2px solid; border-right: #000000 2px solid; } nav ul li a { display: block; line-height: 40px; width: 100%; height: 100%; text-decoration: none; text-align: center; } div#clear { clear:both; } CSSは以上の通り書きました。 このとき、section#headerで設定した、img#LOGOとp.introを含むヘッダー部分と、 section#linksで設定したナビゲーション部分に間が空いてしまいます。 どうすれば開かなくなるでしょうか。 閲覧環境はChromeです。

    • ベストアンサー
    • CSS

専門家に質問してみよう