Open JaimeCheng opened 4 years ago
zxx: 本期要点
- grid-template-columns: repeat(auto-fill, minmax(150px, 1fr))。auto-fill:自动填充(列表个数动态),minmax()是一个只用在grid布局中的函数,尺寸范围,最小150px,最大1整个格子填满整行。
- flex实现了类似的效果,子项:flex: 1 1 33%; min-width: 140px; 可以添加的额外的占位,这样最后的比例都是一致的。
- 使用查询语句@media screen and (min-width: 600px) {} 没有任何问题,兼容IE9+,更普世的实现,PC移动通用。也可以和flex布局结合(IE10+)。
- 线的隐藏。流派1:宽高个数固定的实现使用树结构伪类匹配,准确匹配需要绘制分隔线的元素。流派2:隐藏,overflow隐藏,还有一种是实色覆盖(适合容易不能overflow:hidden的场景)。
- 线的绘制。4种。1. 伪元素宽高1像素填色,或者1px边框。2. border+clip-path;3. border-radius > border;4. box-shadow负值,box-shadow: 16px 0 0 -15px;
- inset: 1px ==> left: 1px; top: 1px; right: 1px; bottom: 1px;
题目:
原issue
回答:
优秀回答: grid | flex | @media | box-shadow
总结:
> 在线demo <