我根据题主的思路精简了一下。关键就是要让第四个div不要跟着第三个div,所以要让第三个向右浮动,其他向左浮动。
<!DOCTYPE html>
<html>
<head>
<title>test</title>
<meta charset="utf-8">
<style type="text/css">
.box{
width:1300px;
height: 400px;
margin: 0 auto;
}
.icon1{
width:22%;
height:100%;
background-color: #ccc;
float: left;
}
.icon2{
width:58%;
height:50%;
background-color: #09d4e8;
float: left;
}
.icon4{
width:58%;
height:50%;
background-color: #04802a;
float: left;
}
.icon3{
width:20%;
height:100%;
background-color: #bb5f01;
float: right;
}
</style>
</head>
<body>
<div class="box">
<div class="icon1">1</div>
<div class="icon2">2</div>
<div class="icon3">3</div>
<div class="icon4">4</div>
</div>
</body>
</html>
自己回答吧
<!-- css -->
<style type="text/css">
.box{
width:380px;
height: 60px;
background-color: gray;
}
.icon{
width:20%;
height:98%;
border: 1px solid red;
float: left;
display:inline-block;
}
.icon2{
width:58%;
height:40%;
border: 1px solid red;
display:inline-block;
margin-top: 2px;
}
.icon3{
width:20%;
height:98%;
border: 1px solid red;
display:inline-block;
float: right;
text-align: center;
line-height: 60px;
vertical-align: center
}
</style>
<!-- html -->
<div class="box">
<div class="icon">
<img width="100%" height="100%" alt="" src="../img/icon_138.png">
</div>
<div class="icon3">关注</div>
<div class="icon2">啊大大大阿发</div>
<div class="icon2">爽肤水发发发啊</div>
</div>
最简单的方法就是使用绝对定位