css-定位页脚:div-ul-div-inside-div相邻
我正在尝试定位我的页脚内容。我的页脚中将有3列。在左边,我想要“联系信息”,在中间的“菜单”和右边的“新闻”。 我的页脚的HTML结构如下:css-定位页脚:div-ul-div-inside-div相邻,css,html,html-lists,footer,Css,Html,Html Lists,Footer,我正在尝试定位我的页脚内容。我的页脚中将有3列。在左边,我想要“联系信息”,在中间的“菜单”和右边的“新闻”。 我的页脚的HTML结构如下: <div id="footercontainer"> <div id="footer"> <div id="footerLeft"></div> <ul id="footerCenter"> </ul> <div id="footerRig
<div id="footercontainer">
<div id="footer">
<div id="footerLeft"></div>
<ul id="footerCenter"> </ul>
<div id="footerRight"> </div>
</div>
</div>
#footer{
width:1000px;
margin:auto;
}
#footercontainer{
width:100%;
height:auto;
background:url(../img/prechod_stranka-paticka1920x145.png) no-repeat top center;
background-color:#4e4b47;
overflow:hidden;
}
#footerLeft{
padding-top:80px;
padding-bottom:20px;
width:40%;
padding-left:30px;
float:left;
}
#footerCenter{width:10%;float:left;padding-top:80px; display:block;}
#footerRight{padding-top:80px; width:10%; display:block; }
现在footerLeft和footerCenter相邻,但footerRight位于footerLeft下方。有谁能帮我一下,如何把它们放在一起吗?这是3列布局的基本标记
这就是您要查找的吗?尝试将页脚右侧div的
display:block
更改为display:inline block
#footerRight{ padding-top:80px; width:10%; display:inline-block; }
如果您想将右脚推到中间,可以在footerRight
中添加一个float:left
,如果您想将其推到footer容器的右边缘,可以添加float:right
我放了一个红色的边框,这样你就可以看到你的部门了。我还把你的无序列表包装在一个div中
希望这有帮助
#footerRight{ padding-top:80px; width:10%; display:inline-block; }