View Single Post
Old 03-25-2010, 06:05 AM   #91
charleski
Wizard
charleski ought to be getting tired of karma fortunes by now.charleski ought to be getting tired of karma fortunes by now.charleski ought to be getting tired of karma fortunes by now.charleski ought to be getting tired of karma fortunes by now.charleski ought to be getting tired of karma fortunes by now.charleski ought to be getting tired of karma fortunes by now.charleski ought to be getting tired of karma fortunes by now.charleski ought to be getting tired of karma fortunes by now.charleski ought to be getting tired of karma fortunes by now.charleski ought to be getting tired of karma fortunes by now.charleski ought to be getting tired of karma fortunes by now.
 
Posts: 1,196
Karma: 1281258
Join Date: Sep 2009
Device: PRS-505
Quote:
Originally Posted by Chang View Post
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.
charleski is offline   Reply With Quote