css3 之 一行分列自适应
一行分列并自适应有很多方法,此次使用方法为css3的:flex-flow 属性,方法如下:
display: flex; flex-flow: row;
flex-flow取值有:
nowrap wrap wrap-reverse initial inherit 默认值是 "nowrap"
案例:
.container { margin: 0; padding: 0; display: flex; flex-flow: row; -webkit-flex-flow:row; padding-top: 5px; padding-bottom: 5px; margin-top: -1px; } .main { flex: 1; -webkit-flex:1; color: black; text-align: center; line-height: 20px; } .main a { color: black; } .left img, .main img, .right img { vertical-align: middle; } .left { flex: 1; -webkit-flex:1; text-align: center; line-height: 20px; } .right { flex: 1; -webkit-flex:1; color: black; text-align: center; line-height: 20px; } .right a { color: black; }
效果(忽律两边的黑边):
相关推荐
csstpeixun 2020-08-07
如狼 2020-08-15
anyushan 2020-06-30
zego实时音视频 2020-06-23
oKeYue 2020-06-14
xiaoxiaokeke 2020-05-19
AlisaClass 2020-05-16
Justdoit00 2020-04-26
rionchen 2020-04-09
86384798 2020-04-04
贤冰 2020-03-08
云端漂移 2020-03-05
数据与算法之美 2020-01-23
yuanran0 2019-12-25
CaiKanXP 2019-12-21