M
M
mortyy2017-01-09 15:32:07
HTML
mortyy, 2017-01-09 15:32:07

How to change the size of a flex item depending on the screen size?

How to make it so that when there is one element in a row, it takes up the entire width?
code pen

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Andrey Fedorov, 2017-01-09
@mortyy

Add to css:

@media all and (max-width: 694px) {
  .note-container {
    width: 100%;
  }
}

max-width: 694px is the moment when 2 elements no longer fit into the line. Picked up by eye, do it yourself more precisely.

A
Alexander Belov, 2017-01-09
@AlexanderBelov

.note-container {
    min-width: 310px;
    height: 200px;
    margin: 10px;
    box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
    flex-direction: column;
    width: 100%;
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question