简体   繁体   English

在另一页上复制了页脚html / css,但显示方式有所不同?

[英]Duplicated footer html/css on another page, but shows up differently?

I'm making a website and I completed the main page (header, body, and footer). 我正在制作一个网站,并完成了主页(页眉,正文和页脚)。 I started a new document for my second page. 我在第二页开始了一个新文档。 I copied and pasted the code for the header from the main page into the second page and that worked flawlessly. 我从主页复制标题的代码并将其粘贴到第二页,并且可以正常工作。 But when I did the same for my footer, it resulted in my footer aligning left instead of aligning center. 但是,当我对页脚执行相同操作时,结果导致页脚向左对齐而不是居中对齐。 All the code and the html are the same. 所有代码和html都相同。 I don't know what the problem is. 我不知道问题是什么。 I've been looking everywhere but had no luck so far. 我一直到处寻找,但到目前为止还没有运气。

CSS Code: CSS代码:

.end_text {
    width: 100%;
}

.bottom_left li {
    float:left;
    list-style: none;
}

.bottom_lmid li {
    float:left;
    list-style: none;
    margin-left: 10px;
    margin-top: 7px;
}

.bottom_lmid li:first-child {
    margin-left: 100px;
}

.bottom_rmid li {
    float:left;
    list-style: none;
    margin-left: 10px;
    margin-top: 7px;
}

.bottom_rmid li:first-child {
    margin-left: 100px;
}

.bottom_right li {
    float:left;
    list-style: none;
    margin-left: auto;
    margin-top: 0px;
}

.bottom_right li:first-child {
    margin-left: 100px;
}

HTML Code: HTML代码:

<div id="footer">
    <div class="foot_bar">
        <img src="../../images/bestfoodservicesweb_24.jpg" width="862"/>
    </div>
  <div class="end_text">
            <ul class="bottom_left">
                <li><img src="../../images/bestfoodservicesweb_34.jpg" width="80" height="26"/></li>
           </ul>
            <ul class="bottom_lmid">
                <li><img src="../../images/bestfoodservicesweb_37.jpg" width="63" height="16"/></li>
                <li><a href="http://www.bestfoodservice.us/contact.aspx"><img src="../../images/bestfoodservicesweb_38.jpg" width="63" height="16"/></a></li>
                <li><img src="../../images/bestfoodservicesweb_39.jpg" width="99" height="16"/></li>
               </ul>
                <ul class="bottom_rmid">
                    <li><img src="../../images/bestfoodservicesweb_41.jpg" width="26" height="14"/></li>
                    <li><img src="../../images/bestfoodservicesweb_43.jpg" width="38" height="15"/></li>
                    </ul>
                    <ul class="bottom_right">
                        <li><a href="http://facebook.com"><img src="../../images/bestfoodservicesweb_27.jpg" width="25" height="25"/></a></li>
                        <li><a href="http://twitter.com"><img src="../../images/bestfoodservicesweb_29.jpg" width="25" height="25"/></a></li>
                        <li><a href="http://linkedin.com"><img src="../../images/bestfoodservicesweb_31.jpg" width="25" height="25"/></a></li>
                    </ul>
            </ul>
        </div>
</div>

YOU WILL NEED TO SCROLL DOWN TO SEE FOOTER IMAGES 您将需要滚动查看更多图像

The demo shows how the my footer is suppose to look 该演示显示了我的页脚应该看起来如何

Demo Here Full Screen Demo 演示这里 全屏演示

This is how it looks 看起来就是这样

Demo 2 Full Screen Demo 2 演示2 全屏演示2

I think maybe a tag wasn't closed. 我认为也许标签没有关闭。 But this is what I added: 但这是我添加的内容:

#footer{
   width: 860px;
   margin: 0 auto;
}

And it seems to be working. 它似乎正在工作。 Fiddle 小提琴

You do not have the info_body ul element in the second demo. 在第二个演示中,您没有info_body ul元素。 Adding that should center the footer. 添加那应该使页脚居中。

Also fix the img tag in Demo1, you missed out a " when defining the width. 还要修复Demo1中的img标签,在定义宽度时您错过了"

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM