Safari背景图片问题

时间:2011-07-05 23:40:59

标签: html css

我可以在mac上获取我的背景图片以填充除safari之外的所有浏览器。我以前遇到过背景图片的问题,我终于想弄清楚了。如果有一个“行业标准”可以让背景图像适合所有浏览器,或者专门为某个浏览器设计页面,并根据用户使用的浏览器显示某些页面,我想知道这种技术是什么。此外,当我在safari中打开我的页面时,一切都以某种方式向左移动。我一直想把这些东西拿出来一段时间,而我发现的其他东西都有同样的问题。如果有人能给我一个解决这些问题的解决方案,这将是非常棒的。这是我的html和css的代码。

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>

1 个答案:

答案 0 :(得分:2)

尝试为html添加宽度和高度,以便为body继承:

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

随时为我提供整页背景或视频。