I have a small question concerning css styles and javascript / jquery. Lets say i define the following css style.
.myStile { padding: 5px }
Now I'd like to access the property of padding while not writing an html element to the document. I came up with the following idea which only works with Firefox (IE and Chrome say NaN)
var div = $('<div class="myStile />');
var padding = parseInt(div.css('padding-left'), 10);
is there a way to make this work in IE and Chrome (well trident and webkit I guess) as well? I know that one's able to read whole css files via javascript (and get the class, the properties and so on ...), but that seems to be a bit overkill.