CSS

作者: 大硕_5132 | 来源:发表于2017-10-09 22:03 被阅读0次

    居中

    .class{
    top:50%;
    left:50%;
    transform: translate(-50%, -50%);
    }
    

    Flex

    .class{
    display: flex;
    justify-content: flex-start;
    align-items: center;
    // space-between
    }
    
    .class{
    //不被压缩/放大
    flex-grow: 0;
    flex-shrink:0;
    //占据剩余空间
    flex-grow: 1;
    // 竖直由上向下排列
    flex-direction: column;
    // 由下向上
    flex-direction: column-reverse;
    // 换行 第一行在上方
    flex-wrap: wrap
    }
    

    文本溢出显示省略号

    .class{
    display:-webkit-box;
    -webkit-box-orient:vertical;
    -webkit-line-clamp:2;
    overflow:hidden;
    word-wrap:break-word;
    word-break

    不被挤

        flex-grow: 0;
        flex-shrink:0;
    

    文字换行

    white-space: pre-wrap;
    

    相关文章

      网友评论

          本文标题:CSS

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