S
S
Sector5672019-07-25 12:54:48
Layout
Sector567, 2019-07-25 12:54:48

How to make a flex grid with the ability to set different widths for a single element?

Hello!
That is, how to make, like in bootstrap, so that one element in a row occupies, for example, 2 columns, and the remaining elements in a row have one column each? Do you mean with a standard 12-column grid?
I watched Dmitry Lavrik, the code there was something like this:

.row{
  margin: 0 -15px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
}

.col{
  min-height: 50px;
  margin: 15px;
  width: calc(100% / 12 * 3 - 30px);
}

But with this approach, all elements have the same width, and if in a row you need one of these elements to have, for example, 2 columns, while the rest occupy one column each (PS grid and 12 columns)?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry Khristoev, 2019-07-25
@Sector567

like so?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question