copenndthagen
copenndthagen

Reputation: 50750

How to set device viewport?

I have 2 questions on setting viewport ?

  1. Is the meta tag the only way to set viewport? I mean is it possible through JS or some other way?

  2. I have a Java app (uses JSP/Struts, etc). So can I set it globally from a single place? If yes, can I override it for a particular page if I need to later ?

Upvotes: 1

Views: 3179

Answers (2)

Divya Manian
Divya Manian

Reputation: 1985

You can set the viewport via meta tags and CSS. This article is also a good introduction to viewport property and how you can set it via CSS http://dev.opera.com/articles/view/an-introduction-to-meta-viewport-and-viewport/ and other means.

Upvotes: 1

Thomas Brasington
Thomas Brasington

Reputation: 588

Javascript has a reiszeTo() function that forces the window to change and clientWidth for adjusting the viewport width. This article explains how to combine CSS meta tags and JS to adjust the viewport.

Upvotes: 0

Related Questions