简体   繁体   English

HTML页脚响应不完全对齐

[英]HTML footer responsive not aligning perfectly

I'm trying to create a responsive website. 我正在尝试创建一个响应式网站。 Everything looks great except for the footer when in mobile view the content dont seem to align perfectly. 除了页脚在移动视图中时,其他内容看起来都不是完美对齐。 Here are screenshots. 这是屏幕截图。

This is the desktop view 这是桌面视图

在此处输入图片说明

This is the mobile view 这是移动视图

在此处输入图片说明

As you can see everything is messed up. 如您所见,一切都混乱了。 Here's my code 这是我的代码

<div id="footer" class="navbar navbar-default navbar-fixed-bottom">
            <div class="container-fluid">
                <div class="navbar-text pull-left">
                    <p id="color"> Supported By </p>
                </div>
                <div class="navbar-text pull-left">
                    <a href="http://www.kafd.jo/" target="_blank"><img class="img-responsive" src="Images/King-Abdullah-Fund-Development-Jordan-360-Panorma-Video.png" id="imageclass1"></a>
                </div>
                <div class="navbar-text pull-left">
                    <a href="http://visitjordan.com/" target="_blank"><img class="img-responsive" src="Images/Jordan-Tourism-Board-Visit-Jordan-Lolo.png" id="imageclass1"></a>
                </div>

                <div class="navbar-text" id="centered">
                    <a href="http://www.360mea.com/request-a-recording/" target="_blank"><img class="img-responsive" src="Images/Request-a-Recording-Jordan-360-Panorama.png" id="imagecenter"></a>
                </div>

                <div class="navbar-text pull-right">
                    <a href="http://www.oasis500.com/" target="_blank"><img class="img-responsive" src="Images/Oasis-500-logo-360.png" id="imageclass"></a>
                </div>
                <div class="navbar-text pull-right">
                    <a href="http://www.ayla.com.jo/" target="_blank"><img class="img-responsive" src="Images/Ayla-Logo.png" id="imageclass1"></a>
                </div>
                <div class="navbar-text pull-right">
                    <a href="http://www.manaseergroup.com/" target="_blank"><img class="img-responsive" src="Images/Manaser.png" id="imageclass2"></a>
                </div> 
                <div class="navbar-text pull-right">
                    <p id="color">Partners</p>
                </div>
            </div>
        </div>

And for the CSS 对于CSS

#centered {
    position: absolute;
    overflow: visible;
    left: 40%;
}
#imagecenter{
    max-width: 200px;
    max-height: 200px;
}
#imageclass1{
    max-width: 90px;
    max-height: 90px;
}
#imageclass2{
    max-width: 70px;
    max-height: 60px;
}

And here's my attempt on mobile view 这是我对移动视图的尝试

@media screen and (min-width: 400px) {
    body {
        overflow: auto;
    }
    .img-responsive {
        position:relative;
        max-width: 20%;
    }
    #color{
        font-size: 5px;
    }
    #footer{
        max-height: 200px;
    }
}

If there's an easier approach than the way I did it, I would be very thankful. 如果有比我做的方法简单的方法,我将非常感激。 Thank you! 谢谢!

Bootstrap provides easy ways for designing responsive sites. Bootstrap提供了设计响应站点的简便方法。 You just add classes to your divs and bootstrap's css will do the job! 您只需将类添加到div中,引导程序的css就可以完成工作! You can find it here: http://getbootstrap.com/ 您可以在这里找到它: http : //getbootstrap.com/

忘记在每个元素上向左拉右,并使用col的布局(col偏移将对居中的元素有所帮助)。

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

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