0

SSI を介してページに挿入した html メニューが、ハードコードされたページの幅を超えて左に伸びており、その理由がわかりません...

私のコードを見ると、#menu id が適切にフローティングされている (float:right;) ため問題ですが、幅が何かによってオーバーライドされているように見えます....そして、それをオーバーライドしているものを見つけることができません。 ..... #menu に影響するすべてのプロパティをチェックしましたが、何も影響しません...

これが明確なWebページです:http://unifiedforunifat.com/redesign/homepage.html

メニューが挿入されているホームページのcssは次のとおりです。

body{
font-family: "Trebuchet MS", Helvetica, sans-serif;
margin: 0;
padding: 0;
padding-top: 10px;
}

html{
height: 100%;
}   

#wrapper{
width: 900px;
min-height: 100%;
height: auto;
margin: 0 auto -4em;
}

#header{
position: relative;
top: 0;
left: 0;
margin-bottom: 1px;
}

対応するhtmlは次のとおりです。

<body>
<div id="wrapper">
<div id="header">
<!--#include virtual="/menus/menu.html" -->
</div>

メニューページのcssは次のとおりです。

#menu-wrapper{
position: relative;
width: 900px;
margin: 0 auto;
height: 140px;
}

#logo{
background:url('http://www.unifiedforuganda.com/resources/u4ulogo.jpg') no-repeat;
height: 108px;
width: 200px;
position: relative;
top: 3px;
background-position: 0 0;
float: left;
}

#logo span{
    position: absolute;
    top:0; left:0; bottom:0; right:0;
    background:url('file:///Volumes/Despotos/Users/nojohnny101/Documents/Dropbox/Unified%20for%20UNIFAT/website/resources/u4ulogo.jpg') no-repeat;
    background-position: -200px 0;
}

#logo:hover span{
    opacity: 1;
}


 .social{
position: relative;
margin: 50px 0 0 0;
width: 136px;
float: right;
overflow: hidden;
display: block;
}
#menu{
position: relative;
top: 0;
right: 0;
list-style: none;
display: block;
overflow: hidden;
width: 100%;
margin-top: 0;
padding-top: 4px;
border-top: 1px solid black;
float: right;
}

次に、メニュー ページの html を次に示します。

<div id="menu-wrapper">
<div class="menu-header">
    <a href="http://unifiedforunifat.com/redesign/homepage.html" id="logo" class="imglink"><span></span></a>
</div>
<div class="social">
    <a href="https://www.facebook.com/UnifiedforUNIFAT" id="facebook" target="_blank"><span></span></a>
    <a href="https://twitter.com/unified4unifat" id="twitter" target="_blank"><span></span></a>
    <a href="http://unifiedforunifat.wordpress.com/" id="wordpress" target="_blank"><span></span></a>
    <a href="https://vimeo.com/u4u" id="vimeo" target="_blank"><span></span></a>

</div>
<div>
    <ul id="menu">
        <li class="active"><a href="#">DONATE</a></li>
        <li class="active"><a href="#">ABOUT US</a></li>
        <li class="active"><a href="#">MEDIA</a></li>
        <li class="active"><a href="#">US MOVEMENT</a></li>
        <li class="active"><a href="http://unifiedforunifat.com/redesign/ugandaprograms.html">UGANDA PROGRAMS</a></li>
    </ul>
</div>

どんな助けでも本当に感謝します!

4

1 に答える 1

0

だから私は答えを見つけました...私がやったことはオーバーフローを隠しました。#menu-wrapper id のプロパティ....ハード幅が指定され (900px)、境界線が実際に#menu-wrapper id ではなく #menu id に適用されます.....

しかし問題....ありがとう@MrLister

于 2013-08-21T06:07:18.887 に答える