Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.3k views
in Technique[技术] by (71.8m points)

css3 flex弹性布局问题

上面有三个元素,我是用flex对齐的,每个元素宽度是50%,但是第一个元素高度大的时候,第三个元素就换到下一行了,我想把第三个元素放到第二个元素下面,而不是另整一行,这个怎么解决?
image.png


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

已解决!,

父节点设置为:display: block;
子元素都设置为:float: left;

image.png


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...