首页 > 其他分享 >flex容器的属性flex-wrap用法

flex容器的属性flex-wrap用法

时间:2022-08-21 10:34:32浏览次数:45  
标签:smallbox flex height width background wrap 用法

内容大于盒子宽度

<style type="text/css">
.bigbox{
width: 500px;
height: 400px;
background:#ff0000;
display: flex;
flex-direction: row;
flex-wrap: nowrap
}
.smallbox{
width: 200px;
height: 100px;
background: #f5f5f5;
margin: 10px;
}

</style>

</head>

<body>
<div class="bigbox">
<div class="smallbox">1</div>
<div class="smallbox">2</div>
<div class="smallbox">3</div>
</div>

</body>

</html>

<style type="text/css">
.bigbox{
width: 500px;
height: 400px;
background:#ff0000;
display: flex;
flex-direction: row;
flex-wrap: wrap;
}
.smallbox{
width: 200px;
height: 100px;
background: #f5f5f5;
margin: 10px;
}

</style>

</head>

<body>
<div class="bigbox">
<div class="smallbox">1</div>
<div class="smallbox">2</div>
<div class="smallbox">3</div>
</div>

</body>

</html>

<style type="text/css">
.bigbox{
width: 500px;
height: 400px;
background:#ff0000;
display: flex;
flex-direction: row;
flex-wrap: wrap-reverse;
}
.smallbox{
width: 200px;
height: 100px;
background: #f5f5f5;
margin: 10px;
}

</style>

</head>

<body>
<div class="bigbox">
<div class="smallbox">1</div>
<div class="smallbox">2</div>
<div class="smallbox">3</div>
</div>

</body>

</html>

文章来自 www.96net.com.cn

标签:smallbox,flex,height,width,background,wrap,用法
From: https://www.cnblogs.com/96net/p/16609549.html

相关文章

  • FLEX justify-content 属性项目在主轴上的对齐方式
    FLEXjustify-content属性项目在主轴上的对齐方式1,justify-content:flex-start2,justify-content:flex-end3,justify-content:center4,justify-content: spac......
  • Flex 布局 display:flex 与 inline-flex 区别
    1.Flex布局 display:flex.bigbox{width:500px;height:400px;background:#ff0000;display:flex;}.smallbox{width:100px;height:100p......
  • 定时任务-crontab简单用法
    定时任务-crontab简单用法crotab定时任务:在服务器上设置定时器,来执行特定的任务脚本,比如phpXXX或者pythonXXX,或者gorun***crontab基本用法:-crontab时间设置:......
  • Linux case语句用法
    case命令case语句与if-then-else语句的区别。例1:if-then-else语句,比较繁琐[19:37:32root@libin3libin]#usermod-Grootstudent[19:22:33root@libin3libin]#......
  • @RequiredArgsConstructor用法
    在我们写controller或者Service层的时候,需要注入很多的mapper接口或者另外的service接口,这时候就会写很多的@Autowired注解,代码看起来很乱.lombok提供了一个注解:@Required......
  • nmcli命令用法
    Linux下用nmcli命令做网卡绑定,你还不会用?原创 Cloud研习社 Cloud研习社 2022-06-1210:33 发表于山东收录于合集#实战经验33个#Linux122个#IT23个#计算机37......
  • xargs命令用法
    linux之xargs使用技巧原创 入门小站 入门小站 2022-06-1123:08 发表于北京收录于合集#Linux485个image-20210603130606567Unix命令都带有参数,有些命令可以接......
  • C#中的static静态变量的用法
    静态局部变量定义:在局部变量前加上static关键字时,就定义了静态局部变量。特点:A、该变量在全局数据区分配内存。B、初始化:如果不显式初始化,那么将被隐式初始化为0......
  • linux shell if语句用法
    12.1使用if-then语句1、第一种if-then语句bashshell的if语句会运行if后面的那个命令。如果该命令的退出状态码是0(该命令成功运行),位于then部分的命令就会被执行。如......
  • python菜鸟学习: 10. 函数的基本用法
    #-*-coding:utf-8-*-#回参函数deftest01():return0#以元组返回参数deftest02():return1,[1,2,3,4,5],{"name":"liyuzhoupan"}#有参函数deftest......