سؤال

the html menu that i have inserted into the page through SSI is stretching to the left beyond the hard coded width of the page and i can't figure out why...

if you look at my code, the #menu id is the problem as it is floating properly (float:right;) but the width it seem is being overridden by something....and i can't find out what is overriding it.....i've checked all the properties that would affect #menu but nothing has an effect on it...

here is the webpage where it is clear: http://unifiedforunifat.com/redesign/homepage.html

here is the css for the homepage where the menu is insert:

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

here is the corresponding html:

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

here is the css for the menu page:

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

then here is the html for the menu page:

<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>

any help would be truly appreciated!

هل كانت مفيدة؟

المحلول

so i found the answer...what i ended up doing was put the overflow: hidden; property on the #menu-wrapper id....i don't know if i totally understand why this helped to hide the extra width to the left of the page even though a hard width was specified (900px) and the border is actually applied to the #menu id not the #menu-wrapper id.....

but problem....thanks @MrLister

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top