css中order属性的介绍

265次阅读
没有评论

css中order属性的介绍

1、order可以改变一个flex子项的排序位置。

2、order属性用于提供有关弹性容器中其他弹性项目的每个弹性项目的顺序。 如果商品不灵活,那么order属性将毫无用处。

实例

<style type="text/css">
.box{width: 100px;height: 100px;}
.div{display: flex;}
.bg0{background: #111;}.bg1{background: #444;}.bg2{background: #777;}.bg3{background: #999;}  
.o1{order:-1;}.o2{order:0;}.o3{order:1;}.o4{order:2;}
</style>
<div>
<div class="box bg0">1</div>
<div class="box bg1">2</div>
<div class="box bg2">3</div>
<div class="box bg3">4</div>
</div>
<div class="div po" >
<div class="box bg0 o4">1</div>
<div class="box bg1 o2">2</div>
<div class="box bg2 o3">3</div>
<div class="box bg3 o1">4</div>
</div>

以上就是css中order属性的介绍,希望对大家有所帮助。更多css学习指路:css教程

本文教程操作环境:windows7系统、css3版,DELL G3电脑。

神龙|纯净稳定代理IP免费测试>>>>>>>>天启|企业级代理IP免费测试>>>>>>>>IPIPGO|全球住宅代理IP免费测试

相关文章:

版权声明:JavaScript2022-12-19发表,共计671字。
新手QQ群:570568346,欢迎进群讨论 Python51学习