I am creating large web application using Foundation 3.0 UI framework and it have px based layout and font-sizing.
In design there is “em” based font-size/line-height and padding/margins. I want to know that Is it good option to choose “em” based font size and padding for responsive layout for smartphones?
I think the main advantage for
emin terms of responsive design is the way that you can so easily change the font size for different screen sizes.E.g. if you use media queries for large screens and small screens (say, mobiles and TV’s) you’re going to want to change the font size for both of them.
If you have everything sized in
em‘s you can simply change thefont-sizeon the body, like so:Where as if you had everything sizes in
pxyou’ve have to do a LOT more work resizing the font’s.EDIT: Using
emfor margins + padding may also be a good idea for a responsive layout, as I understand it, if you resize the body font size (as shown above) you’ll also resize the margins + padding (making them either smaller or larger) which could also be very beneficial for a responsive design.