2010-07-13 64 views
0

如何使用div创建两列页脚? (无表)创建两个列页脚使用div?

页脚是980px它应该包含....

版权所有2010 xyz.com(左侧)

关于我们|隐私|条款(右侧)

+0

google for'两列css布局' – 2010-07-13 16:24:26

+1

@meder:用于两列css布局的谷歌搜索提供了非常多的结果,其中很少有与页脚有关的。首先在海报中提供一点诚意。 – jrista 2010-07-13 16:31:00

+0

页脚不是“特殊的”,它们就像任何其他元素一样。它与包含content/sidebar列的包装器没有区别。 – 2010-07-13 16:34:19

回答

2

你可以做这样的事情:

CSS:

.Footer_outer{ 
width: 980px; 
border: 1px solid; 
} 

.Footer_inner_left{ 
width: 49%; 
Float: left; 
display:inline; 
} 

.Footer_inner_right{ 
width: 49%; 
Float: right; 
display:inline; 
} 

HTML:

<div class="Footer_outer"> 
    <div class="Footer_inner_left">Copyright 2010 xyz.com </div> 
    <div class="Footer_inner_right">About us | privacy | terms </div> 
</div> 
+0

这将呈现一个982px的组合宽度元素。此外,浮标不被包含。 – 2010-07-13 16:37:25

+0

这是正确的答案,只需删除“border:1px solid;” – 001 2010-07-14 04:59:46

+0

非常感谢您的更新。 – Kangkan 2010-07-14 06:24:56

2

在你的CSS:

#footerLeft { width: 47%; float: left; display: block; 50px;} 
#footerRight { width: 47%; float: right; display: block; height: 50px; } 
#footer { width: 100%; height: 100% width: 980px; } 

HTML:

<div id="footer"> 
<div id="footerLeft">Copyright 2010 xyz.com</div> 
<div id="footerRight">About Us | Privacy | terms </div> 
</div> 

退房http://www.blueprintcss.org/框架,它将使生活更轻松。

+0

显示:块没有必要,宽度:100%,其次是980px是多余的,怀疑的高度:100%做任何事情。 – 2010-07-13 16:36:58

+0

加上你不包含浮游物。 – 2010-07-13 16:39:11

+0

正确 - 在#footer中不需要宽度:100% - 我应该在发布之前进行校对。 – gnome 2010-07-13 16:39:21

0

CSS:

#footer { overflow:hidden; width:980px; margin:0 auto; } 
#footer #copy { float:left; display:inline; width:490px; } 
#footer #links { float:right; display:inline; width:490px; } 

HTML:

<div id="footer"><div id="copy">copyr..</div><div id="links">blah</div></div>