后台css 100%宽度水平滚动问题 [英] background css 100% width horizontal scroll issue

查看:232
本文介绍了后台css 100%宽度水平滚动问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是面对这个问题,当我将窗口滚动到水平然后页脚和标头断开。

I am facing this issue when i scroll the window to horizontal then the footer and header breaks.

请帮助CSS

您可以在这里查看现场演示 http://yeszindagi.com/

You can check the live demo here http://yeszindagi.com/

    body {
        font-family: Arial, Helvetica, sans-serif;
        font-size:1.3em;
        min-height:100%;
    }


    .containerMain {
        min-height:100%;    
        width: 100%;
    }


    .full {
    width:100%;
    }

    .fixed {
    width:900px;    
    }


    .footer {
        border-top:1px dashed #000;
        margin-top:5px;
        height:50px;
        background-color:#F7B200;
        bottom:0px;
        position:relative;
    }

---------------- ------------ HTML CODE ------------------------------------ ----

---------------------------- HTML CODE ----------------------------------------

    <div class="containerMain">
    ....
    .....
    .........
    <div class="full footer clear ">
        <div class="fixed center">
            <div class="left">
                <ul class="links">
                    <li><a href="#">Contact</a></li>
                    <li><a href="#">Contact</a></li>
                    <li><a href="#">Contact</a></li>
                    <li><a href="#">Contact</a></li>
                    <li><a href="#">Contact</a></li>
                </ul>
            </div>    
            <div class="social right">
                <a href="#" target="_blank" title="Facebook"><span class="facebook-mini"></span></a>
                <a href="#" target="_blank"><span class="twitter-mini" title="Twitter"></span></a>
                <a href="#" target="_blank"><span class="pinterest-mini" title="Youtube"></span></a>
                <a href="#" target="_blank"><span class="linkedin-mini" title="Linkedin"></span></a>
            </div>
        </div>
    </div>
    </div>


推荐答案

解决这个问题的最好方法是通过CSS。

The best way to solve this issue is via CSS.

min-width 应用于其父容器,并确保其子代有 width:100%。见下文:

Apply a min-width to its parent container and make sure its children have a width: 100%. See below:

.containerMain {
    width: 100%;
    min-width: 900px;
}
.footer {
    width: 100%;
}

这篇关于后台css 100%宽度水平滚动问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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