Barry B
Barry B

Reputation: 47

@media query code

Can this be done?

.col is the main section.

If I resize from above 1142px to 1141px I want the .col to disappear.

If I resize, I can see the .kaartmw but the .col doesn't disappear.

If I resize from less 1141pxpx to 1142px and above the .kaartmw will disappear just like I want to have.

That can't be done with this code.

The question is why?

Note that I have changed the max-width and min-width

/* MEDIA QUERY 1142px*/
@media screen and (min-width:1142px){
    .kaartmw {
        display: none;
    }

/* MEDIA QUERY 1142px*/
@media screen and (max-width:1141px){
    .col {
        display: none;
    }

Upvotes: 0

Views: 41

Answers (1)

Quentin
Quentin

Reputation: 943099

You forgot the } to close each media query section.

A validator is a useful tool for detecting this type of problem.

Upvotes: 1

Related Questions