【发布时间】:2016-08-11 00:09:41
【问题描述】:
我正在我的一个页面上测试页脚,以便我可以将它放在每个页面上,但它不能正确显示。目前,页脚 div 中的 div 都堆叠在一起,而不是彼此相邻。此外,div 仅显示应该显示的图像的一部分,而不是整个图像。我也不确定如何通过屏幕尺寸滑动来适当地进行这些更改,因为 div 不会都是统一的尺寸,但应该总是占据屏幕的整个宽度。我的 CSS 是:
.page{
height: 100%;
width: 100%;
text-align: center;
}
.bgood-footer{
width:100%;
height: 20%;
position: fixed;
bottom: 0;
}
.mobile-app{
float: left;
background-image: url('../images-source/mobile-app.png');
background-repeat: no-repeat;
}
.talk{
float: left;
background-image: url('../images-source/talk-to-us.png');
background-repeat: no-repeat;
}
.careers{
float: left;
background-image: url('../images-source/careers.png');
background-repeat: no-repeat;
}
.press{
float: left;
background-image: url('../images-source/press.png');
background-repeat: no-repeat;
}
.blank{
float: left;
background-image: url('../images-source/blank.png');
background-repeat: no-repeat;
}
.fb{
float: left;
background-image: url('../images-source/fb.png');
background-repeat: no-repeat;
}
.yt{
float: left;
background-image: url('../images-source/yt.png');
background-repeat: no-repeat;
}
.tw{
float: left;
background-image: url('../images-source/tw.png');
background-repeat: no-repeat;
}
.ig{
float: left;
background-image: url('../images-source/ig.png');
background-repeat: no-repeat;
}
.ordering-loc{
float: left;
background-image: url('../images-source/ordering-loc.png');
background-repeat: no-repeat;
}
我的 HTML 是:
<div class="page">
<div class="bgood-footer">
<a href="/mobile-app">
<div class="mobile-app">Mobile Application</div>
</a>
<a href="/talk-to-us">
<div class="talk">Talk To Us</div>
</a>
<a href="/careers">
<div class="careers">Careers</div>
</a>
<a href="/press">
<div class="press">Press</div>
</a>
<div class="blank"></div>
<a href="https://www.facebook.com/bgood">
<div class="fb">FB</div>
</a>
<a href="https://www.youtube.com/user/unclefaris">
<div class="yt">YT</div>
</a>
<a href="https://twitter.com/b_good_">
<div class="tw">TW</div>
</a>
<a href="https://twitter.com/b_good_">
<div class="ig">IG</div>
</a>
<div class="ordering-loc">Ordering From Location</div>
</div>
</div>
【问题讨论】:
-
div class blank在这里可能是个坏主意。你想达到什么目的?你想让它分开项目吗?您可以在要分隔的元素上放置一个填充? -
这可能是个好主意,我得到了一张图片来剪切并变成几个按钮,这是唯一没有按钮的部分,这就是我将其标记为空白的原因。