如何在 HTML 中为某些浏览器设置缩放百分比? [英] How to set Zoom % for Certain Browers in HTML?
问题描述
在网页设计中,是否可以根据用户的网络浏览器为用户自动设置缩放百分比?
In web design, is it possible to automatically set a Zoom % for users based on their web browser?
例如,在 Opera 中以 100% 缩放比例打开的网站,如果在 Chrome 中以相同的 100% 缩放比例打开,看起来可能会有所不同.然而,100% Opera 的网站与 125% 缩放的 Chrome 相同.有没有办法设置缩放视图?我是否对视口感到困惑?
For instance, a website opened in Opera with 100% Zoom may not look the same if it was opened in Chrome at the same 100% Zoom. However, the website at 100% Opera scales identically with Chrome at 125% Zoom. Is there a way to set Zoom views? Am I being confused with view-port?
推荐答案
Viewport 是一种定义可视区域的方式(我猜它看起来有点像缩放).但它是一个元标记.
Viewport is a way of defining the viewable area (I guess it looks a bit like zooming). But it's a meta tag.
<meta name="viewport" content="width=device-width" />
css 中有另一种解决方案(检查支持或供应商前缀)
There is another solution in css (check support or vendor prefixes)
@viewport {
width: 980px;
min-zoom: 0.25;
max-zoom: 5;
orientation: landscape;
}
这篇关于如何在 HTML 中为某些浏览器设置缩放百分比?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!