W
W
Waflya150302020-12-21 17:24:59
css
Waflya15030, 2020-12-21 17:24:59

Could you please explain the concept of media queries?

I don't understand how to do media queries at all. I watched a lot of all sorts of videos, read, but somehow it’s hard to get it at all. Can someone explain as simply and understandably as possible?
Thanks in advance

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Y
Yuriy Vorobyov, 2020-12-21
@Waflya15030

It's simple, initially you write your styles for a specific device and extension, and then you want your site to be displayed correctly on other devices and extensions, and here you apply media queries, overriding your styles, for example, you write:

@media (min-width: 600px) and (max-width: 800px) {
/* CSS-стили */;
}

And now the styles defined inside {} will only work for devices whose width is between 600px and 800px inclusive.
It is clear that media queries are not limited to these properties, but there are a wagon and a small cart, but it is enough to understand what it is and why.
The most sensible, in my opinion, "documentation" on media queries is here and here , and here and here are quite good examples.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question