Firefoxで見るとli要素レイアウトが崩れます

このQ&Aのポイント
  • FirefoxやiPhoneで表示すると、フッターメニュー(リンク集~お問い合わせ)の部分のli要素が崩れてしまいます。
  • ブラウザーの倍率は100%で設定されており、li要素の大きさや間隔を調整しても解決しません。
  • CSSのabsoluteプロパティを使用していることが原因かもしれません。どうすればレイアウトを修正できるでしょうか?
回答を見る
  • ベストアンサー

Firefoxで見るとli要素レイアウトが崩れます

http://thai-kosiki.net/のサイトです。 フッターメニュー(リンク集~お問い合わせ)の部分がIEやchromeでは思ったように表示されるのですが、FirefoxやiPhoneで見ると、li要素の一番最後の文字(リンク集だと集)が下に落ちてしまいます。 ブラウザーの倍率はどちらも100%でみています。li要素やul要素の文字の大きさを小さく設定してみたり、li要素の間隔を開けてみたり試してみたのですが、うまくいきません。 フッター部分に設定したCSSです。 div#footer { width: 100%; height: 105px; background-repeat: repeat; background-position: left top; background-color: #FFF; border-top-width: thin; border-top-style: solid; border-top-color: #DFDBDC; clear: both; font-size: 75%; padding-top: 10px; padding-right: 0px; padding-bottom: 10px; padding-left: 0px; } div#footer-inner { width: 1000px; height: 105px; text-align: left; position: relative; margin-right: auto; margin-left: auto; } .footer-nav { position: absolute; left: 308px; top: 30px; width: 508px; } .footer-nav li { float: left; list-style-position: inside; list-style-image: url(../img/common/arrow.png); } .copyright { position: absolute; display: inline-block; width: 177px; left: 823px; top: 30px; } absoluteを使っているのが問題なのでしょうか? FirefoxやiPhoneで見てもレイアウトが崩れないようにするにはどうしたらいいのでしょうか? 間違っている点や追加した方がいい点などがありましたら教えてください。 どうぞよろしくお願いします。

  • CSS
  • 回答数1
  • ありがとう数9

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

  • ベストアンサー
  • SeydaNeen
  • ベストアンサー率43% (26/60)
回答No.1

確かにウチの環境でもずれています。 .footer-nav li { の要素に white-space: nowrap; margin: 0 0.5em; を入れたみたらどうでしょうか。 0.5emの部分は、まあ適当に調整するとして、ですけど。

emi-chan3
質問者

お礼

うまくいきました!ありがとうございます。

関連するQ&A

  • レイアウト、フッターが崩れてしまいます。

    横800pxの外枠にフッター部分を枠内の下に綺麗に収まるよう配置したいのですが、ブラウザーで確認するとフッター部が上に配置されてたり、mainのテキスト部分や外枠のレイアウトが表示されてなかったり、崩れてしまいます。またsafari、firefoxを使って確認してるのですが、同じように表示されません。どこが間違っているのか、教えて頂けると助かります。 *html <body> <div id="wrapper"> <div id="headir"> <h1>The highest hiphop design All group</h1> <div class="logo"><img src="#”></div> </div> <span id="menu"><ul><li><img src="#" alt="#" width="200" height="100" /></li><li><img src="#" alt="#" width="200" height="100" /></li><li><img src=”#" alt="#" width="200" height="100" /></li><li><img src="#" alt="#" width="200" height="100" /></li></ul></span> <h2><img src="#" alt="#" /></h2> <span id="sidemenu"> <ul> <li><a href="#">TOP</a></li> <br /> <li><a href="#">NEW</a></li> <br /> <li><a href="#">Line</a></li> <br /> <li><a href="#">Fine</a></li> <br /> <li><a href="#">Mail</a></li> <br /> <li><a href="#">TOP02</a></li> <br /> <li><a href="#">NEW02</a></li> <br /> <li><a href="#">Line02</a></li> <br /> <li><a href="#">Fine02</a></li> <br /> <li><a href="#">Mail02</a></li> </ul> </span> <div id="main"> ~~ ~~ </div> <div id="footer"> <span align="center">&copy;#</span> </div> </div> </body> </html> *css body { font-family: "MS P明朝", "細明朝体", "ヒラギノ明朝 Pro W3"; margin:0px; padding:0px; } #wrapper { margin: auto; padding:auto; height: 100%; width: 800px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-left-style: solid; border-top-color: #000000; border-right-color: #000000; border-left-color: #000000; border-bottom-style: solid; border-bottom-color: #000000; } #headir { padding: 0px; margin:0px; height: 220px; width: 800px; } #headir h1{ margin: 0px; padding: 0px; height:20px; font-family: "MS P明朝", "細明朝体", "ヒラギノ明朝 Pro W3"; font-size:small; text-align: left; } .logo{ padding-bottom:20px;} #menu ul { padding-top : 0px; padding-left : 0px; padding-right : 0px; padding-bottom : 0px; margin-top : 0px; margin-left : 0px; margin-right : 0px; margin-bottom : 0px; width:800px; height:100px; list-style-type : none; } #menu li{ display:inline; padding-bottom:20px; } span#sidemenu { height: 300px; width: 50px; float:left; margin-top: -19px; margin-right: 8px; margin-bottom: 0px; margin-left: 0px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #000000; border-right-color: #000000; border-bottom-color: #000000; border-left-color: #000000; font-size: smaller; } span#sidemenu li{ list-style-type:none; text-indent: -30px; } span#sidemenu{ padding-top: 20px; padding-right: 20px; padding-bottom: 20px; padding-left: 20px; } div#main { margin-top: 20px; margin-right: 40px; margin-left:30px; margin-bottom:20px; font-size: small; text-align: left; left: 150px; light: 50px; height: 400px; width: 600px; } div#main p { padding-left:10px; padding-light:20px; padding-top:10px; padding-bottom:20px; } #footer{ height:30px; width:100%; background-color: #CC9933; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border: 1; border-left-width: 1px; border-left: 1; z-index: 2; position: relative; margin: 0; padding: 20px 0 0 20px; }

  • addressタグを入れると揃わない

    かなり簡素なページをデザインしていますが、フッターの画像をaddressタグではさむと、フッター画像だけ20ピクセル程右に寄ってしまい全体が揃いません。addressを除くと揃うのですが。 ページのソースは htmlファイル <div id="wap"> ここにSWFファイル <div id="nav"> <ul> <li>~</li> </ul> </div> <address><img footer.jpg" /></address></div> CSSファイル #wap { width: 800px; height: 570px; text-align: left; margin-right: auto; margin-bottom: 50; margin-left: auto; position:absolute; left:50%; top:50%; margin-top: -285px; margin-left: -400px; } #nav { background-color: #666666; margin-top: 0px; margin-bottom: 0px; font-size: 12px; color: #FFFFFF; float: left; width: 100%; } #nav ul { list-style-type: none; margin: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 28px; } #nav li { display: inline; padding: 0px; } 全体を#wapに入れて上からSWF、リストタグのナビ、画像のフッターと入った大変簡素なページですが、フッターの画像をadreesタグで挟むとフッター部分だけ左に20ピクセル程ずれて揃わなくなります。 どなたか解消出来る方おられませんでしょうか。

  • CSS IEとfirefoxおなじレイアウトにしたいのですが

    初心者です。↑質問ですが IEでレイアウトはみれてもfirefoxでは崩れてしまいそれの 対処で困ってしまっています。 どなたかアドバイスください。 ↓のCSSなのですが、途中混乱したままの投稿となってしまっていますが おわかりなられるかた助けてください! ロゴがメイン画像にのっかったりと崩れがたえません。 body{ margin-top: 60px; padding: auto; background-color: #000000; background-image: url(../image/back.gif); color: #000000; cursor: crosshair; } P{ margin: 0; } h1{ font-family: serif; font-size: 5pt; color: #000000; } /*imgDIV↓*/ #lightbox{ width: 100%; z-index: center; text-align: center; background-repeat: no-repeat; } /*toplogo*/ #wrapper{ position: relative; width: 100%; margin: auto; margin-bottom: 20px; margin-left: auto; margin-right: auto; } #logo{ padding-top: 50px 50px 50px 50px; position: absolute; left: 410px; } /*グローバルナビ*/ #hako { margin-top: 150px; line-height:50px; padding-left: 900px; } #hako li { display:inline; list-style:none; padding-right:12px; float: left; background: url(../image/bpin.gif) left top no-repeat; line-height: 12px; padding-left: 17px; } #hako li{ font-family: DejaVuSans; font-size: 12px; } #hako li a { color:#C0C0C0; text-decoration:none; border-bottom:solid 2px #ADABAE; } #hako li a:hover { color:#FFFF66; border-bottom:solid 1px #CC0000; }

  • liタグのナビボタンがFirefoxで二重に表示。

    liタグでナビボタンを縦に3つ積みたいのですが、IEでは正しく表示しますが、何故かFirefoxでは2段めから2つずつ表示してしまい5つのナビボタンになってしまいます。どのように記述すれば良いのでしょう? <div id="sidebar"> <ul> <li id="aaa"><a href=""><span>aaa</span></li> <li id="bbb"><a href=""><span>bbb</span></li> <li id="ccc"><a href=""><span>ccc</span></li> </ul> </div> div#sidebar { width: 245px; float:left; border-right-width: 1px; border-right-style: solid; border-right-color: #CCCCCC; } div#sidebar ul li a { display: block; } div#sidebar ul li a span { position:absolute; width: 0; height: 0; overflow:hidden; } ul li#aaa a { width: 245px; height: 60px; background-image:url(image/aa.jpg); background-position: 10px 20px; background-repeat: no-repeat; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: #999999; } ul li#bbb a { width: 245px; height: 60px; background-image:url(image/bb.jpg); background-position: 10px 20px; background-repeat: no-repeat; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: #999999; } ul li#ccc a { width: 245px; height: 60px; background-image:url(image/cc.jpg); background-position: 10px 20px; background-repeat: no-repeat; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: #999999; }

    • ベストアンサー
    • CSS
  • Firefoxだとメニューバーが崩れてしまいます。

    movable typeでなんとかここまできました。 http://www.mamyu.jp これをFirefoxでみますと、メニューの部分だけ大幅に崩れてしまいます。 スタイルシートの問題だと思うのですが、 その部分は、 #nav { margin-left: 0; padding-left: 0; list-style-type: none; border-top: 0px solid #999999; border-right: 1px solid #999999; border-bottom: 1pxsolid #999999; background-image: url(images/beansmenu01.gif); background-repeat: repeat-x; background-position: bottom; height:25px; width: 849px; float: left; } #nav a { font-size: 12px; font-weight: bold; color: #0000CC; text-decoration: none; background-repeat: no-repeat; background-position: left top; display: block; height: 25px; width: 121px; padding-top: 6px; padding-right: 0px; padding-bottom: 0px; padding-left: 20px; } #nav a:hover { color:#cc3300; background-repeat: no-repeat; } #nav li { float: left; width: 121; } としており、 テンプレート部分は、 <ul id="nav"> <li><a href="http://www.mamyu.jp/">TOP</a></li> <li><a href="http://www.mamyu.jp/000">ブログ</a></li> <li><a href="http://www.mamyu.jp/001">政治信条</a></li> <li><a href="http://www.mamyu.jp/002">プロフィール</a></li> <li><a href="http://www.mamyu.jp/003">政治家養成塾</a></li> <li><a href="http://www.mamyu.jp/007">競馬場問題</a></li> <li><a href="http://www.j-beans.jp">ホームページ</a></li> </ul> としております。 これでどうしてFirefoxだと大きく崩れてしまうのか。崩れない方法はないものかわからないままです。それぞれのメニューバーの左側にでる○印がなんとも邪魔なのです。。。。

  • css: IEでsidebarが表示されない

    cssで2カラムのページを左右を両方floatさせて作っています。 firefoxでは表示されるsidebar(背景、画像、テキストを含むすべて)がIE7では表示されません。clearfixの問題かと思いclearfixを入れてみましたがうまくいきませんでした。 どうしたらよいかご存知の方がいたら教えてください。よろしくお願いします。 ちなみにCSSの主要部分は以下のとおりです。 /*--- container ---*/ #container {position: relative;     background:url(images/background.jpg) repeat-y; width: 800px; hight: 600px; padding: 0; margin-left: auto; margin-right: auto; text-align: left; border: 0; } /*--- header ---*/ #header {width: 800px; height: 107px; margin:0;} /*--- side-bar ---*/ #side-bar{position:absolute; background: transparent url(images/menu_bckgrnd.png) center center no-repeat; width: 150px; padding:0; float:left;} #side-bar ul { margin: 0; padding: 50px 50px 50px 50px;    ist-style: none;         width:30px;} #side-bar li { margin: 0; padding: 0;} #side-bar li a{ display:block;} #side-bar a:hover{position: relative; top: 1px; left: 1px;} /*--- main-nav: content area ---*/ #main-nav {background: url(images/design.png) top left no-repeat; width: 610px; margin-top: 0 0 0 150px; padding: 0 10px 0 30px; float:right;} #main-nav a:hover {position: relative; top: 1px; left: 1px; } #content1{ float:left; width:200px; margin: 0 2px 20px -20px; background:#fff;} #content2{ float:left; width:200px; margin: 0 2px 20px 2px; background:#fff;} #content3{ float:left; width:200px; margin: 0 2px 20px 2px; background:#fff;} /*--- footer ---*/ #footer {width: 800px; height: 100px; background: transparent; margin: -100px 0 0 0; clear: both; text-align:center; padding-top:50px;} /* -- clearfix -- */ .clearfix{ zoom:1; } .clearfix:after{content:'.'; display:block; visibility:hidden; height:0; clear:both;}

    • ベストアンサー
    • CSS
  • CSSでfloatした要素の高さを100%にしたい

    はじめまして。 下記のコードは、HTMLファイルで<head>内に<style>を設けて、そこでCSSを操作しています。 この中で<section>が一か所あるのですが、この要素を一番したの<footer>まで届かせたいのですが、hight: 100%, min-height:100%などにしても言うことを聞いてくれません。 heightを極端に大きくすれば<footer>まで届きますが、それ以外にCSSを使ってきちんとアジャストする方法があれば、ご教授いただければ幸いです。 以下コードです。 <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title></title> <style> html { height: 100%; } body { height: 100%; margin: 0; position: relative; } #root { background: #ccc; min-height: 100%; width: 100%; } header { background: red; height: 30px; width: 100%; } nav { background: gray; float: left; width: 20%; height: 400px; } section { background: green; float: left; width: 70%; min-height: 100%; /** <----- なぜか下まで行かない **/ padding: 60px 0; } footer { background: blue; height: 200px; width: 100%; position: absolute; bottom: -25px; left: 0; margin: 0; } </style> </head> <body> <div id="root"> <header>header</header> <nav>nav</nav> <section>section</section> <footer>footer</footer> </div> </body> </html> 

    • ベストアンサー
    • CSS
  • スタイルシートのpositionでフッターを位置指定するには

    こんにちは。今回ページレイアウトにテーブルではなくcssのpositionを使おうと思っているのですが、フッターの指定がうまくいきません。フッターの上のメインコンテンツや右カラム、左カラムが短い場合は問題ないのですが、長くなるとフッターにかかってしまいます。左カラム、メインコンテンツ、右カラムのどれが長くなっても常にフッターがページの最下部に下がるようにするにはどのように指定すればいいですか?ちなみに今こんな感じで指定しています。 フッターをbottom:0px;で指定すれば常に一番下に来ると思ったのですが…。スクロールしない範囲での一番下にしか来ません…。 /* 左カラム */ #left_column { position: absolute; top: 130px; left: 10px; background-color: #FFFFFF; width: 150px; /* height: 500px; */ border: 1px solid #000; padding: 0px; } /* メインコンテンツ */ #main_contents { position: absolute; top: 130px; left: 165px; background-color: #FFFFCC; width: 490px; /* height: 500px; */ border: 1px solid #000; padding: 10px; } /* 右カラム */ #right_column { position: absolute; top: 130px; left: 660px; background-color: #FFFFFF; width: 200px; /* height: 500px; */ border: 1px solid #000; padding: 10px; } /* フッター */ #footer { position: absolute; bottom: 0px; left: 10px; background-color: #EEE; width: 850px; border: 1px solid #000; padding: 20px; }

  • 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
  • IE6にてliタグに対してposition:absolute;を使ったときのバグについて

    すみません、質問させて下さい。 下記のソースとスタイルシートでIE6の場合だけliが原因と思われる余白ができます。他のモダンブラウザ、IE7以降ではhrの部分を除いて問題ありませんでした。余白をなくす方法はないでしょうか。 ソース <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <link href="test.css" type="text/css" rel="stylesheet"> <title>test</title> </head> <body> <div id="wrapper"> <div id="header"> <h1>test</h1> </div> <div id="contents"> <div id="lefty"> <p>test test test (略)</p> </div> <div id="righty"> <p>test test test (略)</p> </div> </div> <hr> <div id="navi"> <ul> <li id="list01"><a href="#">赤</a></li> <li id="list02"><a href="#">青</a></li> </ul> </div> <div id="footer"> <address>copyright.</address> </div> </div> </body> </html> スタイルシート @charset "shift_JIS"; * { margin: 0; padding: 0; } body { text-align: center; } #wrapper { margin: 0 auto; width: 760px; position: relative; text-align: left; } #header { width: 760px; height: 100px; background-color: #CC9900; } #contents { width: 760px; } #lefty { width: 380px; float: left; background-color: #CCC; } #righty { width: 380px; float: right; color: #FFF; background: #000 } #list01 a { display: block; width: 180px; padding: 30px 0 0 0; overflow: hidden; background: url(images/nav01.gif) no-repeat; height: 0px !important; height/**/: 30px; position: absolute; top: 30px; right: 0; } #list02 a { display: block; width: 180px; padding: 30px 0 0 0; overflow: hidden; background: url(images/nav02.gif) no-repeat; height: 0px !important; height/**/: 30px; position: absolute; top: 60px; right: 0; } #list01 a:hover { display: block; width: 180px; padding: 30px 0 0 0; overflow: hidden; background: url(images/nav01_on.gif) no-repeat; height: 0px !important; height/**/: 30px; position: absolute; top: 30px; right: 0; } #list02 a:hover { display: block; width: 180px; padding: 30px 0 0 0; overflow: hidden; background: url(images/nav02_on.gif) no-repeat; height: 0px !important; height/**/: 30px; position: absolute; top: 60px; right: 0; } #footer { clear: both; padding-top: 30px; width: 760px; background-color: #990033; } li { list-style-type: none; } a { text-decoration: none; } hr { clear: both; width: 0; } どなたかご教授ください、よろしくお願いします。

    • ベストアンサー
    • HTML

専門家に質問してみよう