Frage

I assume it involves the view-port somehow, but I'm not good at mobile. I'd like to re-size my font and move my elements around.

I see that HTML 5 Boilerplate comes in a mobile form, how and when would I switch to that?

War es hilfreich?

Lösung

You may parse the user agent to determine the mobile platform (e.g., iPhone, iPad, iPod, Android, Opera, Android, BlackBerry, hpwOS, Windows PhoneOS, etc.).

And it is better to use a @media query in CSS to take advantage of the screen dimensions.

For reference:

Andere Tipps

It depends on what you need to change.

To change Boilerplate to Boilerplate Mobile you could have a server-side condition and render a completely different page. If you are using some kind of dynamic framework or have direct access to the server you can check for User-Agent

Here is an article that explains how to use mobile-specific JS, CSS and HTML. Hope it helps.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top