CSS has four different unit sizes you can use for your margins, borders, fonts, etc. These are pixels(px), points(pt), ems (em) percentages (%).
We can separate these units in tow different groups , fixed and relative. Pixels(px) and points (pt) are fixed whereas em and percents(%) are relative unit size. Relative unit sizes are really powerful when creating scalable layouts. Fixed size units are good to use when you always want the same element size no matter where you place it.
Em Vs Percent
--------------------
In theory , both the em and the percent units are identical , but in application , they actually have a few minor differences that are important to consider.
When the client browser text size is set to "medium" there is no difference between ems and percent.
when the setting is altered, however, the difference is quite large. On the Smallest setting ems are much smaller than percent, and when on the "Largest" setting, it's quite the opposite, with ems displaying much larger than percent.
We can separate these units in tow different groups , fixed and relative. Pixels(px) and points (pt) are fixed whereas em and percents(%) are relative unit size. Relative unit sizes are really powerful when creating scalable layouts. Fixed size units are good to use when you always want the same element size no matter where you place it.
Em Vs Percent
--------------------
In theory , both the em and the percent units are identical , but in application , they actually have a few minor differences that are important to consider.
When the client browser text size is set to "medium" there is no difference between ems and percent.
when the setting is altered, however, the difference is quite large. On the Smallest setting ems are much smaller than percent, and when on the "Largest" setting, it's quite the opposite, with ems displaying much larger than percent.
No comments:
Post a Comment