SSI元素在页面宽度之外延伸

时间:2013-08-16 20:30:43

标签: html css menu width ssi

我通过SSI插入页面的html菜单向左伸展超出页面的硬编码宽度,我无法弄清楚为什么......

如果你看看我的代码,#menu id就是问题,因为它正确浮动(float:right;)但是它似乎被某些东西覆盖的宽度....我无法找出什么覆盖它.....我已经检查了所有会影响#menu的属性,但没有任何影响...

这里是明确的网页: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>

任何帮助都会非常感激!

1 个答案:

答案 0 :(得分:0)

所以我找到了答案......我最终做的是把溢出:隐藏; #menu-wrapper id上的属性....我不知道我是否完全理解为什么这有助于隐藏页面左侧的额外宽度,即使指定了硬宽度(900px)并且边框实际上是应用于#menu id而不是#menu-wrapper id .....

但问题....感谢@MrLister