0

I'm trying to target Android devices with a CSS file, but I've been unsuccessful until now. I'm using the following CSS code:

@media only screen and (max-device-width: 800px) {
    body { max-width: 100%; background-color:#000; }
}

I'm also invoking the css code with the following line in the PHP file:

<link rel="stylesheet" type="text/css" href="small.css" />

Any thoughts on what I might be doing wrong?

Thanks

Brad Christie
  • 100,477
  • 16
  • 156
  • 200
impakt
  • 1
  • 1

1 Answers1

0

Within PHP, you can check user agent, and based on that apply an appropriate style sheet.

And don't forget the viewport setting within a meta tag:

<meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;" />
Kon
  • 27,113
  • 11
  • 60
  • 86