HTML & CSS
Bungiorno from 2 degrees C wetherby UK
On this site http://tutorial.davidclick.com/2menu.html & illustrated here http://i216.photobucket.com/albums/cc53/zymurgy_bucket/em-margin_zpsf33b2cfc.jpg Ive creayed spoacing between the two paragraphs using EMS. Is this a better practice than using pixels?
Thanks in advance,
I mostly use ems for vertical margins on elements like p elements and headings but would not use them for for horizontal margins because the margin would be different depending on the font size of the element so they would never align in a straight line. The benefit of ems for vertical margins is that the bigger the text then the bigger the gap is proportionately.
When using ems for containers like divs you must ensure they are all the same font-size to start with then otherwise horizontal em margins would be of no use as they would not line up either.
This topic is now closed. New replies are no longer allowed.