I have a problem with understanding how @media only screen
works. I have three screen sizes:
1) @media only screen and (max-width: 640px)
2) @media only screen and (min-width: 640px) and (max-width: 1250px)
3) @media only screen and (min-width: 1250px)
I want to make that one element would be shown only on large screen size (3), so I wrote:
display: none
on 1) and 2) screens and display: block
on 3) screen.
I also have three style files for each screen size which are put into the main file like this:
@import "large-screen";
@import "medium-screen";
@import "small-screen";
And the small-screen size file overwrites the others:
I don't understand how it can overwrite if it's set to @media only screen and (max-width: 640px)
, doesn't max-width 640px
mean that this code will work when screen is smaller than 640px
? Can someone explain me how this work and how I should write that my element would be displayed only on large screen. Thank you!