Does using em
a开发者_如何学Cs css unit solve the problem in difference in monitor resolution (800x600 vs. 1024x768)?
Yes, em
sets the css targets size relative to the pre-calculated em block
of the parent. See wikipedia for more info on what an Em is.
Basically, as the resolution goes up, the computed size of an Em goes up to. The size of the Em block is a function of the resolution, and the users-preference (font-size) -- so you get the best of both worlds.
This is why W3C suggests using Em for fluid displays.
If by "solving the problem in difference in monitor resolution" you mean making it scale like a vector image, then no. An em is a unit of measurement that scales depending on the font size the user has selected (for me using default settings, 1 em is equal to 16 pt font), and doesn't scale depending on the user's screen resolution.
精彩评论