flex-box

作者: 亨锅锅 | 来源:发表于2018-11-12 17:39 被阅读0次

flex布局常用属性总结

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        *{
            margin: 0;
            padding: 0;

        }

        ul{
            width: 900px;
            height: 700px;
            border: 1px solid #000;
            list-style: none;
            margin: 100px auto;
            display: flex;
            /*flex-direction: row;*/
            /*flex-direction: row-reverse;*/
            /*flex-direction: column;*/
            /*flex-direction: column-reverse;*/

            /*justify-content: flex-start;*/
            /*justify-content: flex-end;*/
            /*justify-content: center;*/
            /*justify-content: space-between;*/
            /*justify-content: space-around;*/
            /*justify-content: space-evenly;*/

            /*align-items: flex-start;*/
            /*align-items: flex-end;*/
            /*align-items: center;*/
            /*align-items: baseline;*/
            /*align-items: stretch;*/


            /*flex-wrap: nowrap;*/
            /*flex-wrap: wrap;*/
            /*flex-wrap: wrap-reverse;*/

            /*align-content: flex-start;*/
            /*align-content: flex-end;*/
            /*align-content: center;*/
            /*align-content: space-between;*/
            /*align-content: space-around;*/
            /*align-content: space-evenly;*/
            /*align-content: stretch;*/

            /*flex:flex-grow flex-shrink flex-basis;*/


        }

        ul>Li{
            flex-basis: 300px;

            width: 200px;
            height: 200px;
            background: deepskyblue;
            line-height: 200px;
            text-align: center;
            float: left;
            border: 1px solid #ff0000;
            box-sizing: border-box;
            /*flex-grow: 1;*/
        }

        li:nth-child(1){
            /*padding-top: 20px;*/
            /*align-self: flex-end;*/
            /*order: -1;*/
            /*flex-shrink: 3;*/
        }

        li:nth-child(2){
            /*order: -2;*/
            /*flex-grow: 2;*/
            /*flex-shrink: 2;*/

        }

        li:nth-child(3){
            /*flex-shrink: 1;*/

        }

    </style>
</head>
<body>
<ul>
    <Li>x</Li>
    <Li>y</Li>
    <Li>z</Li>
</ul>
</body>
</html>

补充(2019-02-12),最近在学习小程序的过程中发现腾讯官方的flex布局文档,十分牛波,附上链接:

https://developers.weixin.qq.com/ebook?action=get_post_info&docid=00080e799303986b0086e605f5680a

相关文章

  • flex布局2

    任意一个容器都可以设置为flex-box 行级元素也可以设置为flex-box; 注意当给盒子设置成flex后,它...

  • Appending image dynamically

    Image container Using block-box cover flex-box: block-box...

  • flex-box

    1.display:flex;(写在父级元素的CSS样式中,其子级元素就会默认的同行排列),设置成flex之后,子...

  • Flex-box

    吐槽 最近一直在学习H5,因为之前有过JavaScript的基础,所以重点放在了HTML和CSS以及一些相关的框架...

  • flex-box

    flex布局常用属性总结 补充(2019-02-12),最近在学习小程序的过程中发现腾讯官方的flex布局文档,十...

  • flex-box入门

    目录结构 basic.css index.html style.css 备注:取消注释,逐一尝试即可

  • Vue.js学习笔记(5)

    关于Flex-box布局学习: 1、容器(flex container),所有的子元素自动成为容器成员 容器默认两...

  • 前端笔记

    容易忘记的部分 从左到右不换行,超出才换行flex-box m-flex-box-wrap div旋转45度 隐藏...

  • flex-box属性总结

    概述 CSS3引入了一种新的布局模型——flex布局。flex是flexible box的缩写,一般称为弹性盒模型...

  • [React-Native]RN组件学习-FlexBox布局

    flex-box布局实践(一) 基础知识: flex属性flex属性将会控制所属的view的大小为剩余空间的比例:...

网友评论

      本文标题:flex-box

      本文链接:https://www.haomeiwen.com/subject/qyicfqtx.html