2016-04-24 85 views
0

網站:ifnrussiacisforum.ru頁腳是不是在移動設備上正確顯示

它是在PC機上100%的寬度,但有一些空的空間移動,likt這樣: enter image description here

的代碼是:

HTML:

<div class="footer"> 
    <div class="container"> 
     <img src="images/logo-img.jpg" alt="beeboss" /> 
    </div> 
</div> 

CSS:

.footer { 
    height: 60px; 
    width: 100%; 
    background: #000; 
    } 

.footer .container { 
    width: 1003px; 
    margin: 0 auto; 
} 

.footer .container img { 
    margin:19px 0px 0px 20px; 
    } 
+0

你試過寬度:100% – gurvk

+0

'寬度:1003px;'是不好的反應。我建議使用'100%'或者至少'100vw' –

+0

嘗試寬度:100% - 仍是同樣的問題。嘗試在兩個設備上。 – kulan

回答

0

使用這個CSS代碼

CSS:

.footer .container { 
    width: 100%; 
    margin: 0 auto; 
} 

.footer .container img { 
    margin:19px 0px 0px 20px; 
    } 
+0

試過寬度:100% - 仍然是同樣的問題。嘗試在兩個設備上。 – kulan

0

解決了這個代碼的問題:

html, body { 
    min-width: 1003px; 
} 
0

編織:http://kodeweave.sourceforge.net/editor/#58fb912e2d456f902a77b8ebc76aa515

默認情況下,body標籤有一個margin。您可以通過將Normalize整合到您的CSS中或從您的身體中刪除margin

編輯:難怪爲什麼你的寬度如此怪誕,你在大多數容器上定義了800px1003px。加上你的CSS相當不錯WET

更改以下類width100%

  • .footer .container
  • 。主要
  • .header

然後替換最小寬度/從800px & &改變你的寬度1003px80%以下類別。

  • .extra - 巴利
  • .request形式
  • 。鏈路
  • .plashka
  • .bally
  • 的.Mac

此外,還要注意使你的代碼更DRY

body { 
 
    margin: 0; 
 
} 
 

 
.footer { 
 
    height: 60px; 
 
    width: 100%; 
 
    background: #000; 
 
} 
 

 
.footer .container { 
 
    width: 100%; 
 
    margin: 0 auto; 
 
} 
 

 
.footer .container img { 
 
    margin: 19px 0 0 20px; 
 
}
<div class="footer"> 
 
    <div class="container"> 
 
    <img src="https://forums.gota.io/images/smilies/smile.png" alt="beeboss" /> 
 
    </div> 
 
</div>

相關問題