forzar el mismo tamaño de fuente en todos los dispositivos móviles

I would like that my site works like the mobile page of facebook. It is independent what the screen resolution is, the navbar etc. are always the same size. How can I achieve this?

This is how I want it on all devices LG Optimus Black (480 x 800 pixel)

This is how I want it on all devices LG Optimus Black (480 x 800 pixel)

This is how it looks on my Lumia 920 (1280 x 768 pixel)

This is how it looks on my Lumia 920 (1280 x 768 pixel)

preguntado el 13 de septiembre de 13 a las 11:09

What did you try so far? What were the difficulties and outcome? Did you at least take a look on source code of Facebook's mobile page? -

The fb mobile page CSS is very bad to see. I tried this stackoverflow.com/a/15333364/1126393 -

I added some pictures which show what I want :) -

1 Respuestas

You will have to use Javascript for this. Here's a jQuery approach:

if( /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) ) {
    $('body').addClass("mobile");
}

Then you can style appropriately, e.g:

.mobile div {
    width: 100%;
}

CSS media queries will only get you as far as detecting screen size or orientation. There are some but compatibility is an issue.

Respondido el 13 de Septiembre de 13 a las 17:09

I added some pictures how I want it to look like. - Knerd

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.