我不知道如何建立这个简单的布局。
这就是我想要的样子:

..。这就是我到目前为止所拥有的:
http://cssdesk.com/vQ3qr
在右上角如何得到黄色的div?
HTML:
<div class="gray-wrapper">
<div class="red">centered</div>
<div class="yellow">top right corner</div>
<div class="aqua">100% width</div>
</div>CSS
.gray-wrapper{
width:500px;
height:200px;
background:gray;
border:4px solid gray;
}
.red{
width:200px;
height:100px;
margin:0 auto;
background:red;
}
.yellow{
width:50px;
height:100px;
float:right;
background:yellow;
}
.aqua{
width:100%;
height:100px;
background:aqua;
}发布于 2013-07-05 14:13:39
只需将yellow div放在html中的第一位。
<div class="gray-wrapper">
<div class="yellow">top right corner</div>
<div class="red">centered</div>
<div class="aqua">100% width</div>
</div>http://cssdesk.com/KYRTT演示
发布于 2013-07-05 14:21:39
body{background:white}
.gray-wrapper{
width:500px;
height:200px;
background:gray;
border:4px solid gray;
}
.red{
width:200px;
height:100px;
margin-left: 150px;
background:red;
float:left;
}
.yellow{
width:50px;
height:100px;
float:right;
background:yellow;
}
.aqua{
width:100%;
height:100px;
background:aqua;
float: left;
}完成了!
https://stackoverflow.com/questions/17490924
复制相似问题