Amar Amar - 4 years ago 108
CSS Question

Responsive website for phone

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;
}
}

Answer Source

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;
    }
}
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download