4

I would like to set the fixed with for mobile devices on 320px - I would like to want to look my website always the same as on the screen for 320px.

I have tried to set up the fixed width on 320px, like this:

@media (max-width: 320px) {
    body {
        width: 320px;
    }
}

But this code doesn't work me. Is there any way to do it?

user984621
  • 46,344
  • 73
  • 224
  • 412

1 Answers1

6

You could use the meta tag in your html.

<meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=320, height=device-height, target-densitydpi=medium-dpi" />
Romain Braun
  • 3,624
  • 4
  • 23
  • 46
  • some of that isnt necessary, but the first couple of arguments are (user-scalable, initial-scale, maximum-scale, minimum-scale) – sevenseacat Nov 18 '13 at 14:55
  • @sevenseacat Once target-densitydpi helped me on android – Romain Braun Nov 19 '13 at 08:59
  • Could it be the solution to this issue, if yes how? http://stackoverflow.com/questions/24851785/can-i-explicit-define-minimum-pixel-width-on-which-bootstrap-should-switch-to-re – andilabs Jul 20 '14 at 16:11