Originally Posted by Chang
I want to add margin between text and image but I can't do it by using em
as my unit. It works fine with %
but not with em
. Why em
You set font-size to 0, which sets the value of an em
to 0 as well.
From the spec
The 'em' unit is equal to the computed value of the 'font-size' property of the element on which it is used. The exception is when 'em' occurs in the value of the 'font-size' property itself, in which case it refers to the font size of the parent element.
Leave out the font-size attribute, so that it inherits the size of the parent element.