Just wondering – how using jQuery – I can get an elements formatted total padding and margin etc ? i.e. 30px 30px 30px 30px or 30px 5px 15px 30px etc
I tried
var margT = jQuery('img').css('margin');
var bordT = jQuery('img').css('border');
var paddT = jQuery('img').css('padding');
But this doesn’t work ? http://jsfiddle.net/q7Mra/
According to the jQuery documentation, shorthand CSS properties are not supported.
Depending on what you mean by “total padding”, you may be able to do something like this: