Reputation: 11
I read all @media topics on this site and it seems that code should working
body
{
background-color: yellow;
}
@media screen and (min-width: 1080px;) and (max-width: 2000px;)
{
body
{
background-color: green;
}
}
@media screen and (max-width: 1079px;)
{
body
{
background-color: red;
}
}
i have viewport tag, but still background is always yellow... What's the problem?
Upvotes: 0
Views: 66
Reputation: 1
I think you should check if there is a <meta>
tag on the head part of your html document,
Without the tag your media queries will not take effect
Upvotes: 0
Reputation: 11
There are some errors you should try this
body { background-color: yellow; } @media screen and (min-width: 1070px) { body { background-color: red; } } @media screen and (min-width: 1080px){ body { background-color: green; } }
Upvotes: 0
Reputation:
here just take out the ;
body
{
background-color: yellow;
}
@media screen and (min-width: 1080px) and (max-width: 2000px)
{
body
{
background-color: green;
}
}
@media screen and (max-width: 1079px)
{
body
{
background-color: red;
}
}
Upvotes: 1