T
T
theWaR_132016-01-18 14:16:49
css
theWaR_13, 2016-01-18 14:16:49

How correct is this approach?

Good day. I recently started learning how to layout using grids similar to bootstrap grids, and now it's time to try to make the first adaptive site. I typed mobile first, but as soon as it came to the next screen resolutions, I begin to see that the code becomes very confusing. Is this normal or are there other approaches to such layout? Is it right to have a whole separate row for each type of device? And is such a heap of code in .scss files normal? Thank you.
Here is a piece of code: codepen.io/anon/pen/mVqJBQ
PS Most likely you will say that you should use fewer classes in html and use mixins. I redid the bootstrap grid (I used flexbox and a couple of my chips, I haven’t reached the mixins yet, of course, I’ll fix this later).
UPD. In the example I left, the row class is used to move to a new row. In the mobile version of the layout, there are two blocks that are located under each other. In the tablet version, the bottom block crawls one line with the top one. How can this be done using only 1 row?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexey Strukov, 2016-01-18
@theWaR_13

All wrong.
No need to make so many blocks, one is enough, but with different classes.
Classes for different screen sizes are written inside media queries.

W
winbackgo, 2016-01-18
@winbackgo

This approach is fundamentally wrong. The layout should be common for all devices, and you need to bring it into the appropriate form for certain resolutions through css and media-query. The less html markup the better.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question