Yang03 / blog

0 stars 0 forks source link

animation flex #1

Open Yang03 opened 9 years ago

Yang03 commented 9 years ago

animation

属性 描述
@keyframes 规定动画
animation 属性的简写,除了 animation-play-state 属性。
animation-name 规定 @keyframes 动画的名称。
animation-duration 动画持续的时间
animation-timing-function 动画的速度曲线
animation-delay 动画的延迟时间,默认0
animation-iteration-count 动画执行次数,默认1
animation-direction 动画是否在下个周期逆向播放
animation-play-state 动画是否正在运行
animation-file-mode 动画执行完成后的状态

flex

flex-direction定义主轴的方向

flex-wrap 定义flex项目是否换行显示

justify-content 定义了项目在主轴上的对齐方式

align-items 定义与水平方向垂直的对齐

order 数值越小,排列越靠前,默认值为0

flex-basis 定义元素占据的最小空间

flex-shrink 定义元素占据的缩小比例

flex-grow 定义元素占据的比例

Yang03 commented 7 years ago

如何定义一个flex 容器

    .container {
        display: flex;
    }

flex 是一个简写

    flex 1
    /* == */
    flex-grow:1;
    flex-basis:auto;
    flex-shrink: 1;

demo, 左右布局,右边元素固定宽度,左边flex

    .container {
        display: flex
    }

    .left {
        flex: 1
    }
    .right {
        width: 100px
    }

flex-shrink

    flex-shrink: 2  //按照2x倍缩放容器, 默认是1

flex-wrap

    flex-nowrap: nowrap  //(默认), wrap, wrap-reverse

align-content 多行的情况下,在y轴的对齐方式f

flex-start image flex-end image flex-center 8fed-ac0586efd209.png) image

space-between image space-around image space-evenly image strech image

Yang03 commented 7 years ago

https://developer.mozilla.org/zh-CN/docs/Web/CSS/align-items