我必须放大和缩小以改变整个背景颜色(但它可以在IE中使用而不会出现任何问题)! P.S:Body bg颜色默认为灰色。
链接到代码:http://jsfiddle.net/eY44d/
**按钮代码位于身体的尽头**
**当我更改标签并返回时它也能正常工作**
这是整个网站的代码
<body style="background-color:gray; ">
<div style=" float:left;background-color:white; width:13%;height:100%; position:fixed; left:0; top:50px; border: 2px solid black;">
<div id="menu" class="menu"> <a href="image.html">Shirts</a>
<br/>----------------------
<br/> <a href="info.html">Shoes</a>
<br/>----------------------
<br/> <a href="Text.html">Accessories</a>
<br/>----------------------
<br/> <a href="Media.html">About Us</a>
<br/>----------------------
<br/> <a href="mailto:zaid-sh@live.com">Contact Us</a>
<br/>----------------------
<br/>
</div>
</div>
<div id="middle" style=" background-color:white; position:absolute; height:auto%; width:70%; left:15%; top:100px; ">
<div style="position:relative;left:10px;top:10px;margin-right:5%; border: 3px solid #a3a3a3 ; border-spacing:10px;">
<img src="shirt.jpg" alt="shirt" height="325px" width="412" />
</div>
<br/>
<div style="position:relative;left:10px;top:10px;margin-right:5%; border: 3px solid #a3a3a3;">
<img src="shoes.jpg" alt="shoes" height="325px" width="412" />
</div>
<br/>
<div style="position:relative;left:10px;top:10px;margin-right:5%; border: 3px solid #a3a3a3;">
<img src="watch.jpg" alt="watch" height="325px" width="412" ; "/>
</div>
<br/>
</div>
<div id="header-fixed " style="background-color:#4B4B4B; position:fixed; top:0;right:0; width:100%; height:50px; border: 2px solid black; ">
<input class ="resize " id="pic " type="image " src="list.png " onclick="show(); "/>
<input class = "resizecol " type="image " src="blue.png " alt="white " value= "White " onclick="document.body.style.backgroundColor='blue' ; "/>
<input class = "resizecol " type="image " src="black.png " alt="white " value= "White " onclick="document.body.style.backgroundColor='black' ; "/>
<input class = "resizecol " type="image " src="white.png " alt="white " value= "White " onclick="document.body.style.backgroundColor='#FFFFFF' ; "/>
<input id="Register " dir="ltr " style="position: fixed; right: 0px; top: -3px; height: 54px; width: 123px; "
type="image " value="Register " alt="Regsiter " src="register.png " />
</div>
</body>
答案 0 :(得分:0)
试试这个
body{background-color: #657383;}