Skip to content

css #2

@yangchendoit

Description

@yangchendoit

flex space-between

display:flex
justify-content:space-between

实际场景

ul -> li 三列两端对齐 间隔自适应 设置li的width:31%
当某一行只有两列时
展示效果如下图所示
image

我们想要的效果如下图
image

解决办法

ul:after{content:"",width:31%}  

在ul里使用伪类添加一个同等宽度的子元素即可

::after css3语法
:after css2语法
支持CSS3的浏览器同时也都支持CSS2中引入的表示法:after

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions