【发布时间】:2013-07-05 22:21:39
【问题描述】:
我不知道如何构建这个简单的布局。
这就是我想要的样子:
...这是我目前所拥有的:
如何获得右上角的黄色 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;
}
【问题讨论】:
标签: html css css-float positioning