tags:

views:

23

answers:

1

I am trying to clone an element and get its CSS proprieties plus inherited padding and margin. I can get the respective element position, width, padding and margin but I can not get the inherited padding and margin. Is there a way to get the actual rendered CSS and apply it to my clone?

Thanx

A: 

This question is not clear. What is the difference between the inherited padding and margin and the respective padding and margin?

Maybe list a specific example.

Anywho, the answer is probably jQuery's css() function.

Brock Adams
Sorry about that, I'll try to explain. $(this).css(padding) may return 0 if that element does not have padding. However if his parent have padding then my element render according to that parent padding
Mircea
jQuery's `css()` function returns the computed value and should return any inherited values correctly (Is padding inheritable?) Can you post a short code snippet that shows that this is not occurring?
Brock Adams