What em can do which can’t be done by %?
What em can do which can’t be done by % ?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Each offers a different way of determining a value, and each has certain advantages/disadvantages. These also vary depending on the particular property in question.
For font-sizing, there’s little to differentiate the two: both will size the font relative to its parent’s font, and both use the same value (<number>) so should be equally precise.
For other properties, such as width, the difference is very significant. Percentage values effectively provide the ability to vary according to window size. Em-based values allow you to vary dimensions according to font-size. The former is great for handling a range of output devices. The latter is great at maintaining consistent line lengths.