2016-09-28 84 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。 –