Div居中CSS [英] Div centering CSS

查看:122
本文介绍了Div居中CSS的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在努力与我的网站,我试图让底部的div在中心。主文本部分居中显示精细,其中只有文本在中心不对齐的页脚。有人有任何想法我做错了什么?

I am struggling with my website, I am trying to get the divs at the bottom to go in the center. The main text section centers and displays fine, its only the footer where the text won't align in the center. Has anyone got any ideas what I am doing wrong?

这是我的CSS代码。

#footer{
float: left;
width: 100%;
height: 100px;
background-image: url(images/jf_footer.png);
color: #C7C7C7;
font-size: 0.75em;


}

#footercontainer{
width: 960px;
margin:0px auto;
margin-top: 20px;
}

#footertext{
float: left;
text-align:center;
margin-top: 15px;
color: #C7C7C7;
font-size: 1em;
}

#footerlinks{
float: left;    
}

HTML:

<div id="footer">
    <div id="footercontainer">
        <div id="footertext">Copyright NV Blinds 2012</div>
        <div id="footerlinks">
            <ul>
                <li>Home</li>
                <li>About</li>
                <li>The Collections</li>
                <li>Distributors</li>
                <li>Our Team</li>
                <li>Contact</li>
             </ul>
        </div>
    </div>
</div>


推荐答案

很难猜到你在找什么。 。我已经按照网站对齐链接,并且 #footerContainer 位于中心 - 如果窗口大小超过 960px .. well,enough say - check the demo

Its hard to guess what exactly you are looking for.. i've aligned the links side by site and the #footerContainer is at the center -- you can check it if the window size is more than 960px.. well,enough said -- check the demo

这篇关于Div居中CSS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆