Does meta viewport override fixed element width

徘徊边缘 提交于 2019-12-08 09:27:12

问题


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


回答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.



来源:https://stackoverflow.com/questions/7370859/does-meta-viewport-override-fixed-element-width

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!