我想在我的网站的主页上连续放置三个图像。这在我的机器上显示为我想要的,但是在其他机器上尝试时,布局将切换为一行中的2个图像,然后在新行中切换到第三个图像。继承人代码:使用css的图像布局
<body>
<div id="container">
<div id="header">
<h1>
<!--<a href="#"><img src="tracylogo7.jpg" alt="Millington and Hope" /></a> -->
<a href="#"><img src="tracylogoup6.jpg" alt="Millington and Hope" /></a>
</h1>
<h2>
<!--<a href="#"><img src="tracylogo5_header.jpg" alt="Millington and Hope" /></a> -->
</h2>
</div>
<ul id="nav">
<li><a href="index.html">Home</a></li><!--
--><li><a href="stock.html">Stock</a></li><!--
--><li><a href="events.html">Events</a></li><!--
--><li><a href="contact.html">Contact</a></li>
</ul>
<div id="box">
<a href="#"><img src="home4.jpg" alt="Image 1" /></a>
<a href="#"><img src="home_mir.jpg" alt="Image 2" /></a>
<a href="#"><img src="home_urn.jpg" alt="Image 3" /></a>
</div>
<div id="box2">
<a href="#"><img src="tracylogosmall.jpg" alt="Logo" /></a>
</div>
<div id="footer">
<p class="client">Tel: 07858740 E-mail: [email protected]</p>
</div>
</div>
</body>
<style type="text/css">
html,body
{
height: 100%;
width: 100%;
padding: 0;
margin: 0;
}
body
{
background:rgb(171,163,144);
text-align: center;
min-width: 600px;
}
#container
{
margin:0 auto;
background:rgb(171, 163, 144);
width:80%;
}
#header
{
padding: 0px;
color: white;
width:100%;
text-align:center;
}
#footer {
position:fixed;
left:0px;
bottom:0px;
height:25px;
width:100%;
background:rgb(151,143,124);
border-top:solid 1px white;
}
.client
{
color:white;
margin:3px auto;
text-indent:1cm;
text-align:left;
}
#sold
{
color: red;
}
#box
{
position:relative;
margin:0 auto;
width:100%;
height:200px;
margin-top:100px;
}
#box img
{
margin:0 auto;
border:solid 1px white;
margin: 10px;
}
#box2
{
position:relative;
margin-top:260px;
width: 100%;
}
#box2 img
{
margin:0 auto;
opacity:0.5;
filter:alpha(opacity=50);
}
任何人都可以帮助我解决这个问题吗?
当你不指定它们时,我们应该如何纠正你的css? – arkascha 2012-07-27 14:50:32
我的css包含在html之后。它不是为你而出现的阿卡斯卡? – user1356791 2012-07-27 14:56:05
你在说“盒子”里的图像吗? – 2012-07-27 14:56:13