0
當使用Twitter Bootstrap並試圖實現320x50的移動橫幅廣告時,我遇到了一個問題,在移動設備上,橫幅會在左側填充(也可能是右側)。如何在Twitter Bootstrap中刪除Google Adsense 320x50移動廣告中的邊距?
當使用Twitter Bootstrap並試圖實現320x50的移動橫幅廣告時,我遇到了一個問題,在移動設備上,橫幅會在左側填充(也可能是右側)。如何在Twitter Bootstrap中刪除Google Adsense 320x50移動廣告中的邊距?
Bootstrap會自動在身體周圍創建一個20px的填充。爲了消除這一點,就像移動導航欄所做的那樣,在引導響應文件中實現一個新類:
@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;
}