N
N
nikmil2021-11-16 17:01:06
css
nikmil, 2021-11-16 17:01:06

What is the correct way to work with min/max width?

Good evening, please tell me how to do it correctly, if two elements in the parent, then the first child took a width of 400 pixels, if one element, then the first child took the width of the parent?

Now it's like this when there are 2 elements
6193b90082574114807805.jpeg

It should be like this

6193b9402e047929756245.jpeg

And if there is only one element then

6193b96ae1b98225916557.jpeg

Here is the code:

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Ankhena, 2021-11-16
@Ankhena

&-left {
    width: 100%;
    min-width: 400px;

    background: pink;
    &:last-child {
      width: 100%;
    }
  }

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question