javascript - how to measure in width of an HTML element? -


i want keep % width gap between 2 html elements.

is there tool tell gap in % ?

i checked measure tool ....but shows in pixel ...not in %.

what solution ?

edit: want keep td width in % ...not in pixel .....but confused how big width should set ..so visually want see width first , want put width in td.

what should ? tool can on ?

any firefox plugin can on ? have measure firefox plugin installed ...but shows width in pixel ....not in %

i think gonna using jquery

var element_w = $('.your_html_element').width() var page_w = $('body').width() var padding_w = e_w * 100 / page_w  $('.your_html_element').css('padding-left',padding_w+'px') 

Comments

Popular posts from this blog

javascript - Count length of each class -

What design pattern is this code in Javascript? -

hadoop - Restrict secondarynamenode to be installed and run on any other node in the cluster -