常用flex元素(可直接作为公用文件引入)

34 篇文章 0 订阅
/* 文字居中,左右显示 */
.text-align-center{
    text-align: center;
}
.text-align-left{
    text-align: left;
}
.text-align-right{
    text-align: right;
}

/* 文字省略号显示 -webkit-line-clamp: 2;写在响应容器控制显示的行数*/
.text-overflow-num{
    display: -webkit-box;
    overflow: hidden;
    text-overflow: ellipsis;
    word-wrap: break-word;
    white-space: normal !important;
    -webkit-box-orient: vertical;
}
/* 定位问题 */
.relative{
    position: relative;
}
.absolute{
    position: absolute;
}
/* *flex布局* */

.flex {
    display: flex;
}

.flex-row {
    flex-direction: row;
}

.flex-row-reverse {
    flex-direction: row-reverse;
}

.flex-column {
    flex-direction: column;
}

.flex-column-reverse {
    flex-direction: column-reverse;
}

.flex-wrap {
    flex-wrap: wrap;
}

.align-start {
    align-items: flex-start;
}

.align-end {
    align-items: flex-end;
}

.align-center {
    align-items: center;
}

.align-stretch {
    align-items: stretch;
}

.align-baseline {
    align-items: baseline;
}

.self-start {
    align-self: flex-start;
}

.self-center {
    align-self: center;
}

.self-end {
    align-self: flex-end;
}

.self-stretch {
    align-self: stretch;
}

.self-baseline {
    align-self: baseline;
}

.justify-start {
    justify-content: flex-start;
}

.justify-end {
    justify-content: flex-end;
}

.justify-center {
    justify-content: center;
}

.justify-between {
    justify-content: space-between;
}

.justify-around {
    justify-content: space-around;
}


/* flex组合 */
.flex-start-start{
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
}
.flex-start-center{
    display: flex;
    align-items: flex-start;
    justify-content: center;
}
.flex-start-end{
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
}

.flex-center-start{
    display: flex;
    align-items: center;
    justify-content: flex-start;
}
.flex-center-center{
    display: flex;
    align-items: center;
    justify-content: center;
}
.flex-center-end{
    display: flex;
    align-items: center;
    justify-content: flex-end;
}
.flex-end-start{
    display: flex;
    align-items: flex-end;
    justify-content: flex-start;
}
.flex-end-center{
    display: flex;
    align-items: flex-end;
    justify-content: center;
}
.flex-end-end{
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
}
.flex-start-between{
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
}
.flex-center-between{
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.flex-end-between{
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
}
.flex-start-around{
    display: flex;
    align-items: flex-start;
    justify-content: space-around;
}
.flex-center-around{
    display: flex;
    align-items: center;
    justify-content: space-around;
}
.flex-end-around{
    display: flex;
    align-items: flex-end;
    justify-content: space-around;
}
.flex-column-center-start{
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
}
.flex-column-center-center{
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.flex-column-center-end{
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
}
.flex-row-center-start{
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
}
.flex-row-center-center{
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
}
.flex-row-center-end{
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-end;
}
.flex-row-wrap{
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
}
//父级设置flex-wrap-between,子级设置flex: 0 0 33%;内容自动填充整个容器且无间隙
.flex-wrap-between {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  
}

//自动换行且自动分布不用设左右间距
.flex-wrap-between-justify {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  text-align: justify;
}

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值