css - Questions about Flex layout
滿天的星座
滿天的星座 2017-06-05 11:13:12
0
5
795

The code I use for flex layout is as follows:
.cszgroup-ul{ display: flex; justify-content: space-between; flex-wrap: wrap; margin-top: 15px; padding-bottom: 5px;}
.cszgroup-ul li{ width: 31%; margin-bottom: 10px;}
The result is this:

My question is: How can I align the red line frame part of the second row to the left?

滿天的星座
滿天的星座

reply all(5)
phpcn_u1582

I haven’t tried it, but I thought of a simple way? Add a placeholder p in the penultimate position and set its visibility to hidden. How about it?

小葫芦
cszgroup-ul {
  justify-content: flex-start;
}
我想大声告诉你

If your li is not dynamically loaded, there is a stupid way to write an empty li and prop it up.

Peter_Zhu

There is no good way, add additional li to occupy the space, and then dynamically add additional nodes to occupy the space after the li here is rendered.

洪涛

Give him margin-left:auto;

for the last one
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!