Reputation: 12865
How would you find out the width of a element that is wrapped by 20 odd other elements, but the only fixed width I know is the main wrapper's which is 800px. All child elements are generally blocks, floating or not, with different paddings and margins.
I don't really need the answer to a specific case, I'm just wondering if there are tools or tricks to quickly calculate such things.
Thanks
EDIT: Sorry to forget, this is on an external site where I can not install any scripts or edit the css.
Upvotes: 1
Views: 192
Reputation: 943097
Firebug is your friend.
How do you get the width of an element without a defined width? - Stack Overflow http://img.skitch.com/20100426-nequkipg8ex3khs1mux3tnctjb.preview.jpgUpvotes: 7
Reputation: 1108537
You need to use element.offsetWidth
.
var width = element.offsetWidth;
Upvotes: 3