flex布局父项常见属性flex-flow

1.flex-flow属性是flex-direction和flex-wrap属性的复合属性


<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Documenttitle>
    <style>
        div{
      
            /* 它的所有子元素自动成为容器成员 */
            display:flex;
            width: 800px;
            height: 400px;
            background-color: pink;
            flex-direction: column;
            flex-wrap: wrap;
        }
        div span {
      
            width: 150px;
            height:100px;
            background-color: purple;
            
        }
    style>
head>

<body>
    <div>
        <span>1span>
        <span>2span>
        <span>3span>
        <span>4span>
        <span>5span>
        


    div>
body>
html>

flex布局父项常见属性flex-flow_第1张图片
/* flex-direction: column;
flex-wrap: wrap; /
/
把设置主轴方向是否换行()换列 简写*/
flex-flow: column wrap;


<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Documenttitle>
    <style>
        div{
      
            /* 它的所有子元素自动成为容器成员 */
            display:flex;
            width: 800px;
            height: 400px;
            background-color: pink;
            /* flex-direction: column;
            flex-wrap: wrap; */
            /* 把设置主轴方向是否换行()换列 简写*/
            flex-flow: column wrap;
        }
        div span {
      
            width: 150px;
            height:100px;
            background-color: purple;
            
        }
    style>
head>

<body>
    <div>
        <span>1span>
        <span>2span>
        <span>3span>
        <span>4span>
        <span>5span>
        


    div>
body>
html>

flex布局父项常见属性flex-flow_第2张图片
flex布局父项常见属性flex-flow_第3张图片

你可能感兴趣的:(flex布局父项常见属性flex-flow)