2011-07-05 53 views
0

我可以得到我的背景圖像來填寫除了Safari瀏覽器之外的每個瀏覽器。之前我曾經遇到過背景圖片的問題,我最終希望能夠解決這個問題。如果有一個「行業標準」讓背景圖像適合所有瀏覽器,或者爲特定的瀏覽器設計頁面,並根據用戶擁有的瀏覽器來顯示特定的頁面,我想知道這種技術是什麼。另外,當我在safari中打開我的頁面時,所有內容都會以某種方式向左移動。我一直在試圖弄清楚這些東西,而我發現的其他人也有同樣的問題。如果任何人都可以給我一個解決這些問題的方法,那就太棒了。這是我的HTML和CSS的代碼。Safari背景圖像問題

HTML:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
    <html xmlns="http://www.w3.org/1999/xhtml"> 
<head> 

<link rel="stylesheet" type="text/css" href="home.css" /> 

</head> 
<body> 

<div class="container"> 

<div class="logo"> 
<img src="IB SportsTV Logo.png" width="240px" height="180px"/> 
</div> 


<p class="teaser">July 24th</p> 


</div> 
</body> 
</html> 

CSS:

<style type="text/css"> 

@import url("reset.css"); 

html 
{ 
padding:0; 
margin:0; 
} 
body 
{ 
background-image:url("HomeIBSTVBG.png"); 
background-size:100%; 
background-repeat:no-repeat; 
background-color:black; 
} 
.container 
{ 
width: 73.2em; 
margin: 0 auto; 
position:relative; 

} 
.login 
{ 
position:absolute; 
top:50px; 
right:100px; 
color:white; 

font-family:trajan pro; 
} 
.register 
{ 
position:absolute; 
top:300px; 
right:100px; 
} 
.text 
{ 
color:white; 
font-size:20px; 
font-weight:bold; 
font-family:trajan pro; 
} 
.logo 
{ 
position:absolute; 
top:-20px; 
left:100px; 
} 
.box 
{ 
position:absolute; 
top:20px; 
left:15px; 
overflow:hidden; 
width:470px; 
height:310px; 
} 
.boxtext 
{ 
position:absolute; 
bottom:-300px; 
width:470px; 
height:310px; 
font-size:25px; 
font-family:trajan pro; 
color:white; 
} 
.twitterfeed 
{ 
position:absolute; 
top:240px; 
left:100px; 
} 

/*memberpage box properties*/ 
.gamebox 
{ 
position:absolute; 
top:150px; 
right:100px; 
} 
.leaderboardbox 
{ 
position:absolute; 
top:165px; 
left:100px; 
} 
.viewerspotbox 
{ 
position:absolute; 
top:370px; 
left:93px; 
} 


/*picks page properties*/ 
.mainform 
{ 
position:absolute; 
top:150px; 
left:100px; 
color:white; 
font-family:trajan pro; 
border:solid darkblue; 
background-color:blue; 
} 
.form2 
{ 
position:absolute; 
top:150px; 
right:400px; 
color:white; 
font-family:trajan pro; 
border:solid darkblue; 
} 
.form3 
{ 
position:absolute; 
top:500px; 
right:400px; 
color:white; 
font-family:trajan pro; 
border:solid darkblue; 
} 
.form4 
{ 
position:absolute; 
top:850px; 
right:400px; 
color:white; 
font-family:trajan pro; 
border:solid darkblue; 
} 
.form5 
{ 
position:absolute; 
top:1200px; 
right:400px; 
color:white; 
font-family:trajan pro; 
border:solid darkblue; 
} 

/*Leaderboard Table Properties*/ 
.tablehead 
{ 
color:white; 
font-family:trajan pro; 
background-color:blue; 
border-color:darkblue; 
} 
.tablecontents 
{ 
color:white; 
text-align:left; 
font-family:trajan pro; 
background-color:transparent; 
border-color:darkblue; 
} 
.tableposition 
{ 
position:absolute; 
top:250px; 
left:150px; 
} 
caption 
{ 
caption-side:bottom; 
color:white; 
font-size:42px; 
font-family:trajan pro; 
} 
/*teaser text*/ 
.teaser 
{ 
color:black; 
font-family:trajan pro; 
font-size:72px; 
position:absolute; 
left:450px; 
top:250px; 
} 

</style> 

回答

2

嘗試添加寬度和高度爲HTML,給身體的東西繼承:

html { 
    width: 100%; 
    height: 100%; 
} 

工作對我來說一切有整頁背景或視頻的時間。

+0

謝謝!這工作! – user830593