HTML 页脚响应不完美对齐

标签 html css twitter-bootstrap responsive-design

我正在尝试创建一个响应式网站。一切看起来都很棒,除了页脚,在移动 View 中内容似乎没有完美对齐。 这是屏幕截图。

这是桌面 View

enter image description here

这是移动 View

enter image description here

如您所见,一切都搞砸了。这是我的代码

<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>

对于 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;
}

这是我在移动端的尝试

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

如果有比我这样做更简单的方法,我将不胜感激。 谢谢!

最佳答案

忘记每个元素上的左拉和右拉,使用 col 布局(col offset 将有助于居中的布局)。

关于HTML 页脚响应不完美对齐,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34525674/

相关文章:

javascript - 无法使用 javascript 根据键和值对 textarea 中的条目进行排序?

html - 我如何将一个元素层叠在另一个元素之下?

html - 无序列表的问题

css - 使用 Bootstrap 或 CSS 在同一行上的 HTML 文本框和文本

twitter-bootstrap - Font Awesome 图标在 chrome 中显示为正方形?

javascript - 提交表单并重定向页面

html - 嵌套的最大宽度和最小宽度 div

javascript - 动画页面回流?

javascript - 如何使用 Angular 7 更改 CSS 类

html - 使用 bootstrap col 时图像左右两侧的空白