Reputation: 529
I'm trying to make a responsive website for mobile. I've just tried the following code to see if this works, but doesn't seem to make the code when I make my webpage smaller in chrome. Is this supposed to be like this or am I missing something? Or do I actually need to go on my phone and try the webpage out?
@media screen and(max-width:480px){
body{
background-color: black;
}
}
Upvotes: 0
Views: 78
Reputation: 5958
You need a space otherwise it is invalid code. https://jsfiddle.net/7fo28qrd/
@media screen and (max-width:480px){//space between `and` and `(`
body{
background-color: black;
}
}
Upvotes: 2