A
A
Anton2020-01-14 14:01:26
C++ / C#
Anton, 2020-01-14 14:01:26

Flex blocks of shares, how to remove the indent from the last blocks in a line?

Hello.
Made blocks on flex adaptive for the promotions section.
There will be more than one action, so I decided to implement it through blocks.
Applied indents from blocks, how to remove the indent from the last block! and the rest of the latter.
I tried to do it through: nth-child (4n), but even does not work.
Maybe the indentation can somehow be organized without adding an additional div in which the indentation style is margined.
Blocks working example:
https://jsfiddle.net/ad36w0u8/1/

Answer the question

In order to leave comments, you need to log in

4 answer(s)
R
res2001, 2019-03-29
@res2001

As far as I understand, in GetRandomMassive(), the randommassive[] array is filled with min_ and max_-5 values, although it was assumed that there would be some random numbers.

A
Anton Usachov, 2020-01-14
Websaytovsky @ws17

For such layouts, it would be logical to use grid instead of flex. And the indents are immediately removed.
Well, if you need exactly flex right here, then this is how you can:

A
Andrew, 2020-01-14
@uselessmindYEAH

.akb:nth-child(4n) .akk {
  margin-right: 0;
}

A
Anton, 2020-01-14
Websaytovsky @ws17

Here is an option: https://jsfiddle.net/Le63nfc0/2/
https://jsfiddle.net/w4euz5d2/

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question