1

I have a simple question related to viewport..

I have a page which has a div with a fixed width of say 1200px..Now i set meta viewport to device-width

So my question is how will the page be rendered now? Will the fixed width of 1200px be respected and viewport will be ignored OR will the device width override any fixed width on the page?

Also will this rendering behavior be same across all mobile browsers?

Just to add, i have already gone through the nice article on http://www.quirksmode.org/mobile/viewports2.html

copenndthagen
  • 49,230
  • 102
  • 290
  • 442
  • i believe the meta viewport would take top priority, i guess its time to get out eclipse, turn on your android sdk and give it a whirl ! – Xavier Sep 10 '11 at 09:36
  • I asked this question bcoz if u see this page on iPad http://ipad.atwebpages.com/vp2.html. It has a fixed width div of 1200px and i used meta viewport as device width..768px on iPad..So ideally speaking it should show 768px content and scrollbars for rest..But that is not the case ? – copenndthagen Sep 10 '11 at 09:39
  • when you set a view-port it tends to lock the screen to the maximum size so anything above and beyond that it wont be displayed. – Xavier Sep 10 '11 at 10:07
  • But viewport means ur page will be rendered as 100% width = that viewport value...so i did not understand what is happening on the link i posted above.. – copenndthagen Sep 10 '11 at 10:09
  • I have already answered this for you when you asked it first in http://stackoverflow.com/questions/7344886 – Chris Sep 11 '11 at 08:07

1 Answers1

1

viewport will NOT override fixed width when there is something wider than device's width.

example. css fixed width to 900px; there is an image width 900px in that page. viewport will only wrap the words to device width but not resize layout width. if you remove that image, the viewport may override fixed width.

vee
  • 4,506
  • 5
  • 44
  • 81