1

我正在为我的网站创建一个页脚块。我不是专家css。我希望在左侧和右侧创建一个带有填充的块。

附件是页脚块的示例,我希望创建:在此处输入图像描述

但是,我创建的页脚块跨越了整个屏幕。知道有什么问题吗?

这是我的CSS代码:

#footer-row1{
    margin-top: 80px;
    padding: 1.2em 0;
    background: #000;
    bottom: 0;
    margin-right: -33px;
    font-family: "Fjalla One", Verdana, Geneva, sans-serif;
    font-size: 0.95em;
    text-transform: uppercase;
}

这是footer.html代码

<div id="footer-row1">
                    <div id="footer-bg">
                        <div id="footer" class="container_24">
                            <div class="copyright">
                              #COPYRIGHT#&COPY;{var name='copyright_year'} {var name='sitename'}. &nbsp;&nbsp;{var name='footer_menu'}
                          </div>
                        </div>
                    </div>
                </div>

谢谢

4

3 回答 3

3

检查这个小提琴

 #footer-row1{
    margin-top: 80px;
    padding: 1.2em 0;
    background: #000;
    bottom: 0;
    margin-right: -33px;
    font-family: "Fjalla One", Verdana, Geneva, sans-serif;
    font-size: 0.95em;
    text-transform: uppercase;

}

.copyright{
    text-align: center;
    color: #FFF;
}
于 2013-08-22T14:33:20.567 回答
1

根据我对上面的理解,你可以减少很多并从图像中获取页脚。您真正需要的是以下内容:

CSS

footer {
    padding: 1.2em 0;
    background: #000;
    font-family: "Fjalla One", Verdana, Geneva, sans-serif;
    font-size: 0.95em;
    text-transform: uppercase;
    text-align:center;
    /* you probably need to add some extra styles here */
}

HTML

<div class="footer">
    #COPYRIGHT#&COPY;{var name='copyright_year'} {var name='sitename'}. &nbsp;&nbsp;{var name='footer_menu'}
</div>

这会将类似于图像的内容放在内容的底部。

于 2013-08-22T14:22:21.320 回答
0

的CSS:

#footer-row1{
        margin-top: 80px;
        padding: 1.2em 0;
        background: #000;
        bottom: 0;
        margin-right: -33px;
        font-family: "Fjalla One", Verdana, Geneva, sans-serif;
        font-size: 0.95em;
        text-transform: uppercase;

    //add
        text-align: center;
        display: block;
        width: 100%;
        clear: both; //because you have some float on the previous "row"

    }

并添加:

 #footer-row1 a{ //for you link
        font-family: "Fjalla One", Verdana, Geneva, sans-serif;
        font-size: 0.95em;
        text-transform: uppercase;
        color: #3399FF; //blue for example
    }

    #footer-previousRow{ //the previous row with list items
        display: block;
        width: 100%;
        height: 260px;
    }

    #footer-previousRow ul.listItem{
        list-style: none;
        list-style-type: none;
        min-height: 36px;
        margin: 0;
        overflow: hidden;
        display: block;
        float: right;
    }

    ul.listItem li{
       color: #CCCCCC;
    }

以及您的 previousRow 的 html 代码:

<div class="footer-previousRow">
    <ul class="listItem">
        <li>Contact</li>
        <li>Social</li>
    </ul>
</div>

<div id="footer-row1"> // your actual code
                    <div id="footer-bg">
                        <div id="footer" class="container_24">
                            <div class="copyright">
                              #COPYRIGHT#&COPY;{var name='copyright_year'} {var name='sitename'}. &nbsp;&nbsp;{var name='footer_menu'}
                          </div>
                        </div>
                    </div>
                </div>
于 2013-08-22T15:22:45.517 回答