📦 Flexbox学习笔记

CSS Flexible Box Layout is a module of CSS that defines a CSS box model optimized for user interface design, and the layout of items in one dimension. In the flex layout model, the children of a flex container can be laid out in any direction, and can “flex” their sizes, either growing to fill unused space or shrinking to avoid overflowing the parent. Both horizontal and vertical alignment of the children can be easily manipulated. (more)

基本设定

1. 设定

<style>
    .box{
        display: flex; /*使用flexbox*/
    }
</style>

<body>
    <div class="box">
        <div>One</div>
        <div>Two</div>
        <div>Three</div>
    </div>
</body>

首先要把三个元素装进flexbox中。

2. 基本属性

  • Axes

    • flex-direction属性

      • row
      • column
      • row-reverse
      • column-reverse
    • flex-wrap属性

    • flex-flow属性

      • flex-flow: row wrap;
  • Align

    • align-items属性

      • stretch
      • flex-start
      • flex-end
      • center
    • justify-content属性

      • flex-start
      • flex-end
      • center
      • space-around
      • space-between
      • space-evenly
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • rljs by sennchi Timeline of History Part One The Cognitiv...
    sennchi阅读 7,458评论 0 10
  • 参考阮一峰博客~http://www.ruanyifeng.com/blog/2015/07/flex-examp...
    tency小七阅读 281评论 0 0
  • 《霜降》 早春紫蝶嫩绿芽, 晚秋寒雁落霜花。 冷风杀黄萋萋草, 冻雨湿透枫叶峡。 秋衣冬帽裹童少, 暖阳街边晒午霞...
    常乐人生阅读 212评论 0 4
  • 关于节点配置 1.时间同步date -s "2015-5-8 19:48:00" (只要所有机器时间一样...
    0_9f3a阅读 543评论 0 1
  • 这学期我利用课余时间,在一个小女孩家做家教,给她辅导功课。 小女孩在一所国际学校读二年级,成绩不是特别好。有一天,...
    想到什么就写什么阅读 388评论 1 1