我按以下顺序有3个浮动Div.
(1)(2)(3)
我想改变Div的顺序如下
(2)(1)(3)
请指导我如何实现这一目标?
码:
<div class="div1">1</div>
<div class="div2">2</div>
<div class="div3">3</div>
div{
height:50px;
text-align:center;
line-height:50px;
}
.div1{width:50%; background:red; float:left;}
.div2{width:40%; background:yellow; float:left;}
.div3{width:10%; background:green; float:left;}
Run Code Online (Sandbox Code Playgroud)
你可以做这种类型的编码
.div1{width:50%; background:red; display:inline-block;}
.div2{width:40%; background:yellow; float:left;}
.div3{width:10%; background:green; float:right}
Run Code Online (Sandbox Code Playgroud)
http://jsfiddle.net/u7psuzor/3/