R
R
run1822018-02-02 16:37:10
css
run182, 2018-02-02 16:37:10

How to make a responsive grid using grid with 2 columns of different sizes?

It is necessary to make an adaptive layout: 2 blocks - the left one with the menu and the right one with the content, when the screen size decreases, the width of the right one decreases to a certain threshold, after which it goes to a new line.

<div style="display:grid;grid-template-columns:repeat(auto-fit, minmax(270px, 1fr));">
    <div>Menu</div>
    <div>Content</div>
</div>

The option as I showed above is suitable, but you need to make sure that the left block has a fixed 270px, and the right one has a rubber one, but not less than 600px, after which it goes to a new line.
I hope I expressed myself clearly. Thank you in advance!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
remeder, 2018-02-02
@remeder

https://habrahabr.ru/company/edison/blog/343796/

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question