【发布时间】:2012-08-07 14:51:11
【问题描述】:
在使用 Twitter Bootstrap 并尝试实施 320 x 50 移动横幅广告时,我遇到了一个问题,即在移动设备上,横幅会在左侧(也可能在右侧)有填充。
【问题讨论】:
标签: mobile twitter-bootstrap adsense
在使用 Twitter Bootstrap 并尝试实施 320 x 50 移动横幅广告时,我遇到了一个问题,即在移动设备上,横幅会在左侧(也可能在右侧)有填充。
【问题讨论】:
标签: mobile twitter-bootstrap adsense
Bootstrap 会自动在您的身体周围创建一个 20 像素的填充。要删除它,就像对移动导航栏所做的那样,在引导响应文件中实现一个新类:
@media (max-width: 767px) {
body { // The code that creates a padding around the body in mobile
padding-right: 20px;
padding-left: 20px;
}
.google-adsense, // Create a new class for your ad with -20 margins (The navbar
// is already implemented like this so just add new class name)
.navbar-fixed-top,
.navbar-fixed-bottom {
margin-right: -20px;
margin-left: -20px;
}
【讨论】: