2016-09-28 72 views
0

我剛剛進入編碼一個星期左右,直到現在約5-6小時,但由於某種原因,我的背景只在Safari中顯示?只在Safari中顯示的CSS背景

html{ 
 
    background-image: url(pics/doucheklein.jpg); 
 
    height: 100%; 
 
} 
 
body { 
 
    font-family: "Comic Sans MS"; 
 
    
 

 
} 
 

 
em{ 
 
    font-weight: bold; 
 
    color: aliceblue; 
 
} 
 

 
em1{ 
 
    font-weight: bold; 
 
    color:chartreuse; 
 
} 
 

 
img { 
 
    border: 1px solid black; 
 
    outline: 5px inset blue; 
 
} 
 

 
#prankerinfo { 
 
    
 
    top: 50px; 
 
     left: 50px; 
 
     width: 100px; 
 
     height: 400px; 
 
     position: absolute; 
 
     
 
    border-style: solid; 
 
    border-left-width: thick; 
 
    border-color: black; 
 

 
} 
 

 
#sickprankerpic { 
 
top: 200px; 
 
    left: 450px; 
 
    height: auto; 
 
    position: absolute; 
 
    
 
    border-style: double; 
 
    border-width: thick; 
 
    border-color: black; 
 
} 
 

 
#gmaps{ 
 
    top:300px; 
 
    left: 300px; 
 
    width: 300px; 
 
    height: 300px; 
 
    position: absolute; 
 
    
 
}
<!DOCTYPE html> 
 

 
<html> 
 
    <head> 
 
     <link rel="stylesheet" href="style.css"> 
 
    <title>Sarude Dankstorm</title> 
 
    </head> 
 
    
 
    <body> 
 
     <div id="prankerinfo"> 
 
     <h4>The best prankster on youtube!</h4> 
 
     <p><a href="https://www.youtube.com/user/JoeySalads"><b><u><i>Subscribe</i></u></b></a></p> 
 
     <p><em>Name:</em>Sick prankster Afghanistan</p> 
 
     <p><em1>Adress:</em1><a href="https://www.google.nl/maps/place/Peachy+In+The+Secret+Hideout/@1.3041018,103.8581836,17z/data=!4m12!1m6!3m5!1s0x31da19b6c17eb7d1:0x2d021381dbf79a7b!2sPeachy+In+The+Secret+Hideout!8m2!3d1.3040964!4d103.8603723!3m4!1s0x31da19b6c17eb7d1:0x2d021381dbf79a7b!8m2!3d1.3040964!4d103.8603723?hl=nl" </a> Secret hideout</p> 
 
     
 
     </div> 
 
      <div class="gmaps"> 
 
     <iframe 
 
    width="300" 
 
    height="250" 
 
    frameborder="0" style="border:0" 
 
    src="https://www.google.com/maps/embed/v1/place?key=AIzaSyC8YwGwvlNWXGcf92JTE6ymhCMNHp5n4MI 
 
    &q=Secret+Hide+Out+ng+Mga+Gadon,Angeles II, Valenzuela, National Capital Region, Philippines" allowfullscreen> 
 

 
     </iframe> 
 
     </div> 
 
     
 
     
 
     
 
     <div id="sickprankerpic"><iframe width="420" height="315" src="https://www.youtube.com/embed/CHt7EBCgJnI" frameborder="0" allowfullscreen></iframe></div> 
 
     
 
    </body> 
 

 

 
    
 
    
 

 
</body1> 
 

 

 

 
</html>

+0

做出的jsfiddle或您的代碼粘貼到的問題。沒有人會從圖像中輸出所有的代碼來測試它。 –

+0

不要忘了在您的瀏覽器中清除您的緩存和Cookie –

+0

根據論壇規則,請在問題**中將代碼作爲文本**發佈。 – EJoshuaS

回答

0

不知道這是很好的做法與否,但它爲我工作。我把它應用到HTML中的CSS是這樣的:

html{ 
    background-image: url(seamlessBackground.png); 
    height: 100%; 
} 

Works for me!

+1

op的實現已經在語法上有效。問題不是語法,由於路徑不正確,最有可能是404。 –