我现在已经阅读了很多论坛和帖子,但似乎没有什么能完全理解我的问题。我在页面底部有一个 100% 宽度的页脚(使用 WordPress 空白主题),不用担心。我在 HTML 5 挂钩内的“脚”div 中有 3 个 div。我希望内部 div“脚”具有相同的宽度并与其上方的包装器保持相同,以便它看起来与包装器的宽度相同 @ 960px 宽。我正在努力弄清楚如何做到这一点。你可以在http://newsite.dramanotebook.com看到我的代码和 css,我相信你知道如何使用 google chrome 或 firefox firebug 。让我知道您认为最好的解决方案,即使这意味着必须更改页面/页脚模板以实现我想要的。
我希望有<footer>
100% 的宽度来扩大用户窗口的宽度,并将<div id="foot">
其限制为 960px 宽度。这是问题所在。我想让它<div id="foot">
与上面网站的其他部分保持垂直对齐。<div id="wrapper"></div>
我指的是。
<div id="wrapper" class="hfeed">
<header>
<div id="branding">
</header>
<div id="container">
<div id="main" class="clearfix">
<!-- I have removed all the bloat in the middle to keep to my issue at hand -->
</div>
<div class="clear"></div>
</div> <!-- end of container div -->
</div> <!-- end of wrapper div -->
<footer> <!-- what I was referring to by HTML hook, my apologies "element"-->
<div id="foot">
<div id="left-footer">
<div id="trustwave_img">
<script type="text/javascript" src="https://sealserver.trustwave.com/seal.js?code=5d243334f2474482a03b5e1f5d5fe4f5"></script>
</div>
</div>
<div id="center-footer">
</div>
<div id="right-footer">
</div>
</div>
</footer>
下面是我目前拥有的相关 CSS,我相信这里有更聪明的人可以帮助我改进以达到我需要的地方,并在此过程中学到一些东西 :)。
body {
font-size: 16px;
font-family: Tahoma, Helvetica, Verdana;
color: #424242;
line-height: 1.4em;
background: #fdffd0;
}
#wrapper {
width: 960px;
margin: 0 auto;
overflow: hidden;
Position: relative;
background: #fff;
padding: 0 10px;
border-left: 1px solid #cccccc;
border-right: 1px solid #cccccc;
}
#container {
position: relative;
overflow: hidden;
clear: both;
padding-bottom: 40px;
}
footer {
clear:both;
width: 100%;
height: 150px;
border-top: 1px solid #eee;
background-color: #A4EDA1; /*#9BE398;*/
opacity: .8;
}
footer #foot {
width: 960px;
height: 150px;
margin-left: 127px;
position: relative;
}
#left-footer {
width: 241px;
height: 100%;
float: left;
position: absolute;
top: 0;
left: 0;
}
#center-footer {
width: 496px;
margin-left: 365px;
height: 100%;
}
#right-footer {
width: 240px;
float: right;
height: 100%;
position: absolute;
top: 0;
right: 0;
}
谢谢,吉姆