尝试将页脚链接与一些文本对齐

时间:2014-09-18 23:51:27

标签: html css center footer

我正在尝试将页脚链接与其附近的某些文本对齐。文本我可以使用text-align,但这对链接不起作用。有人知道解决方案吗?

jsfiddle - http://jsfiddle.net/p7fxqmrc/1/

<footer>
    <p>Copyright 2014</p>
    <ul>
        <li><a href="#">Home</a></li>
        <li><a href="#">Services</a></li>
        <li><a href="#">About Us</a></li>
        <li><a href="#">Contact</a></li>
    </ul>
</footer>



footer p{
    color:#5b5a5a;
    font-family:arial;
    font-size:14px;
    float:left;
    margin:10px;

}

footer ul li{
    float:left;
    margin:10px;

}

footer ul li a{
    text-decoration:none;
    color:#5b5a5a;
    font-family:arial;
    font-size:14px;
    float:left;

}

1 个答案:

答案 0 :(得分:1)

请检查:jsFiddle

这是更新后的CSS:

footer p {
    color:#5b5a5a;
    font-family:arial;
    font-size:14px;
    margin:10px;
    text-align: center;
}
footer ul li {
    margin:10px;
    list-style: none;
    display: inline-block;
}
footer ul li a {
    text-decoration:none;
    color:#5b5a5a;
    font-family:arial;
    font-size:14px;
}
footer ul {
    text-align: center;
    padding-left: 0px;
}