2017-02-16 71 views
0

我有一些與.main背景有關的問題。我試圖獲得背景的全部寬度,但我不能。我看過一些類似的問題,但我無法解決我的問題。這是我的代碼。這是我的字體,所以你可以看到更好的我的觀點。 Fonts主要背景全寬

<!DOCYPE html> 
 
<html> 
 
\t <head> 
 
\t \t <title>MaxSkins-Home</title> 
 
\t \t 
 
<style type="text/css"> 
 
\t \t 
 
\t \t body { 
 
\t \t \t background-color: white;  
 
\t \t \t background-attachment: fixed;    
 
\t \t \t margin: 0; 
 
\t \t \t padding: 0; 
 
\t \t \t width: 100%; 
 
\t \t \t height: auto; 
 
\t \t \t min-width: 1000px; 
 
\t \t } 
 

 
\t \t @font-face { 
 
\t \t \t font-family: "Jocker"; 
 
\t \t \t src: url("JockeyOne-Regular.ttf") format("truetype"); 
 
\t \t } 
 

 
\t \t @font-face { 
 
\t \t \t font-family: "Pacifica"; 
 
\t \t \t src: url("PacificaCondensed-Regular.ttf") format("truetype"); 
 
\t \t } 
 

 
\t \t @font-face { 
 
\t \t \t font-family: "ReklameScript"; 
 
\t \t \t src:url("ReklameScript.ttf") format("truetype"); 
 
\t \t } 
 

 
\t \t h1 { 
 
\t \t \t font-size: 120px; 
 
\t \t \t text-align: left; 
 
\t \t \t font-family: "Jocker"; 
 
\t \t \t margin-left: 45; 
 
\t \t \t color: rgb(200,101, 103); 
 
\t \t } \t \t 
 

 
\t \t h2 { 
 
\t \t \t font-size: 70; 
 
\t \t \t margin-left: 224; 
 
\t \t \t font-family: "Jocker"; 
 
\t \t \t color: rgb(200,101, 103); 
 
\t \t } 
 

 
\t \t #header { 
 
\t \t \t width: 100%; 
 
\t \t \t height: 50px; 
 
\t \t \t margin: auto; 
 
\t 
 
\t \t } 
 
\t \t 
 
\t \t #navigacija { 
 
\t \t \t width: 100%; 
 
\t \t \t margin-left: 0px; 
 
\t \t \t padding: 0px; 
 
\t \t \t height: 50px; 
 
\t \t \t overflow: hidden; 
 
\t \t \t text-align: right; 
 
\t \t \t position: fixed; 
 
\t \t \t background-color: #089DE3; 
 
\t \t \t z-index: 9999; \t \t \t 
 
\t \t } 
 
\t \t 
 
\t \t #navigacija a { 
 
\t \t \t color: white; 
 
\t \t \t text-decoration: none; 
 
\t \t \t line-height: 50px; 
 
\t \t \t font-size: 30px; 
 
\t \t \t font-family: "Pacifica"; 
 
\t \t \t display: inline-block; 
 
\t \t \t padding-left: 50px; 
 
\t \t \t padding-right: 50px; 
 
\t \t \t padding-top: 0px; 
 
\t \t \t padding-bottom: 0px; 
 
\t \t } 
 
\t 
 
\t \t #navigacija a:hover { 
 
\t \t \t background: #00C5CD; 
 
\t \t } 
 
\t \t 
 
\t \t .main1 { 
 
\t \t \t margin-top: 50px; 
 
\t \t \t font-family: "ReklameScript"; 
 
\t \t \t font-size: 50; 
 
\t \t \t background: #089DE3; 
 
\t \t \t text-align: left; 
 
\t \t \t margin-left: 194; 
 
\t \t } 
 
\t \t 
 
\t \t .video-container { 
 
\t \t \t position: relative; 
 
\t \t \t padding-bottom: 56.25%; 
 
\t \t \t padding-top: 0px; 
 
\t \t \t height: 0; 
 
\t \t \t overflow: hidden; 
 
\t \t \t bottom: 930; 
 
\t \t \t right: 0px; 
 
\t \t } 
 
\t \t .video-container iframe, 
 
\t \t .video-container object, 
 
\t \t .video-container embed { 
 
\t \t \t position: absolute; 
 
\t \t \t top: 0; 
 
\t \t \t left: 0; 
 
\t \t \t width: 100%; 
 
\t \t \t height: 100%; 
 
\t \t } 
 
\t \t .video-wrapper { 
 
\t \t \t width: 640px; 
 
\t \t \t float: right; 
 
\t \t \t margin-left:auto; 
 
\t \t \t margin-right:auto; 
 
\t \t \t max-width: 100%; 
 
\t \t } 
 
</style> \t \t 
 
\t \t 
 

 
\t \t </head> 
 

 
<body> 
 
\t <div id="header"> 
 
\t <div id="navigacija"> 
 
     \t \t <a href="Home.html"><b>HOME</b></a> 
 
     \t \t <a href="Shop.html"><b>SHOP</b></a> 
 
     \t \t <a href="#"><b>GET POINTS</b></a> 
 
     \t \t <a href="#"><b>INFO</b></a> 
 
     
 
    \t </div> 
 
\t </div> 
 

 

 
\t \t <h1><b>EARN POINTS,<br> GET SKINS!</b></h1> 
 
\t \t <h2><b>How does it work?</b></h2> 
 
\t <div class="main1"> 
 
\t \t <p><b>It's simple!<br> Watch videos, do tasks and have fun!<br>After earning large amount of coins,<br> contact us to get your skins!<b></p> 
 
\t 
 
\t </div> 
 

 
\t <div class="video-wrapper"> 
 
\t <div class="video-container"> 
 
\t \t <iframe width="640" height="360" src="https://www.youtube.com/embed/lwItL2NXwDw" frameborder="5" allowfullscreen></iframe> 
 
\t </div> 
 
\t <!-- /video --> 
 
</div> 
 
<!-- /video-wrapper --> \t 
 
</body> 
 
</html>

+1

嘗試'body {margin:0; }' –

+0

@MichaelCoker已經做到了。 –

+0

「我試圖獲得背景的全部寬度,但我不能。」這是什麼意思,有什麼不對? – Johannes

回答

0

看來你的問題是一些無效的CSS。您的CSS中有一個<style></style>標記,但只有當CSS位於標記(HTML)內時才需要。

我從您的CSS中刪除了HTML標籤,並且 - 至少對我來說 - 現在有.main1全角背景。 我假設這是你的問題..?

+0

是的,我的CSS是HTML。我要嘗試創建分離的css文件並查看會發生什麼。 –