P
P
photosho2020-03-20 15:55:25
css
photosho, 2020-03-20 15:55:25

Alternative to gap for webkit?

Is there any alternative to the "gap" rule for flex, which is not supported in webkit?

https://jsfiddle.net/zaLdmn46/1/

An alternative to bypass "margin", since one ":last-child {margin: 0px;}" is not enough if at different resolutions a different number of elements wrap to the next line.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Arseny, 2020-03-20
@photosho

There is a crutch. Well, although as a crutch, somewhere, perhaps, an elegant solution:
Let's say we need to set an indent of 50px.

.wrapper {
margin-top: -25px;
margin-bottom: -25px;
..
.child{
margin-top: 25px;
margin-bottom: 25px;

The grid of almost all CSS frameworks is made according to the same principle. But before using read about the collapse of indents.
PS: well, indents to the right and left are already selectors. But it should be obvious.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question