1

I just discovered the initial-scale meta attribute.

Previously, I've been using a default.css to define all my styles and sizes (for fonts and elements) so they appear nicely on screen real estates of desktop computers. Then I might use media queries or PHP to include an phone.css or tablet.css if you're using a phone or tablet, and this will adjust ONLY SIZES for smaller devices.

But now that I've become aware of the concept of initial-scale, should I be using that instead to control sizes of elements?

A very important consequence I'm trying to get at is this...I use to define my font sizes with EM (or REM) units like this:

/*desktop.css*/
html{font-size:62.5%;}
p{font-size:1.2em;}
span {font-size:1em;}

/*phone.css*/
html{font-size:125%;}

/*tablet.css*/
html{font-size:100%;}

In other words, my phone.css and tablet.css only adjusts the font-size percentage on the html element, and all other elements will scale accordingly on all different devices. To a certain degree, i do this wiht padding, margins, lineheights and letterspacing.

With the introduction of initial-scale, does that mean EM/REM units are irrelevant for scaling font sizes? We can stick to the much more intuitive PX units? And let initial-scale do the rest of the scaling work?

4

1 回答 1

0

关于 em 单元的问题是它应该在不同设备和屏幕密度之间显示相同,因为实际高度由客户端决定。

我还在一些应用程序中使用了初始比例、最小比例和最大比例,并且发现 px 单位可以很好地工作,只要您为每个设备的比例选择一个合适的值。

于 2013-04-02T14:02:04.427 回答