Quote:
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 %, pt and px but not with em. Why em doesn't work?
...
Code:
p.image {
line-height: 0.00em;
font-size: 0.00em;
...
|
You set font-size to 0, which sets the value of an
em to 0 as well.
From the
spec:
Quote:
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.