flex_container

flex布局的基本认识:
在这里插入图片描述
flex布局属性作用的基本认知:
在这里插入图片描述
`

  • <style>
     div{
         height: 300px;
         width: 650px;
         background-color: #f3f;
         margin: 0 auto;
     }
     .box1,.box2,.box3{
         height: 100px;
         width: 100px;
     }
     .box1{
         background-color: #f00;
     }
     .box2{
         background-color: #00f;
     }
     .box3{
         background-color: #0f0;
     }
     div{
         display: flex;  
         /*  flex-direction:决定主轴的方向
                             row;默认值,从左到右;
                              row-reverse;从右到左;
                               column;从交叉轴的(上到下);
         flex-direction: row-reverse; */
         /* justify-content:决定内容摆放的样式
                             center;居中
                             column:按列排放 */ 
         /* justify-content: center; */
         /* justify-content: space-around; */
         /* justify-content: space-between; */
         /* justify-content: space-evenly;
         justify-content: space-evenly; */
         /* align-items: 决定内容交叉轴轴的排列方式 
                         center;
         */
         /* align-items:决定类容在交叉轴中的对齐方式;
             align-items: baseline;类容的基线对齐;但是值只对齐第一行内容;
                       flex-end;在交叉中的end对齐;
                     flex-start;在交叉轴的start对齐;
                     center;在交叉轴的center(中心点对齐)
                     align-items: flex-start;
         */
         /* 结论:默认情况在,所有的flex-items都会在同一行显示
             flex-wrap: wrap;多行显示
                     默认值是noweap;
                     flex-wrap: wrap-reverse;反转,
                     flex-wrap:wrap;
         */
         /* flex-flow: row wrap;缩写属性:flex-direction和flext-wrap
         */
         flex-flow: row-reverse wrap;
         /*等分主轴中间的间隔 */
         justify-content: space-evenly;
         /* align-content:决定多行内容在交叉轴上的排列方式 */
         align-content: flex-start;
     }
    

`

<body>
    <div>
        <div class="box1">xiaobox1</div>
        <div class="box2">xiaobox2</div>
        <div class="box3">xiaobox3</div>
        <div class="box1">xiaobox4</div>
        <div class="box2">xiaobox5</div>
        <div class="box3">xiaobox6</div>
        <div class="box1">xiaobox7</div>
        <div class="box2">xiaobox8</div>
        <div class="box3">xiaobox9</div>
        <div class="box1">xiaobox10</div>
        <div class="box2">xiaobox11</div>
        <div class="box3">xiaobox12</div>
    </div>
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值