Is it possible to use jQuery to get the width of an element in percent or pixels, based on what the developer specified with CSS?

I’d say the best way is to compute it yourself:

var width = $('#someElt').width();
var parentWidth = $('#someElt').offsetParent().width();
var percent = 100*width/parentWidth;

Leave a Comment