: Are there tools to measure displayed dimensions in percentages? I use MesureIt! to measure pixels on websites, generally to check if things add up right when developing. I'm making a fluid layout
I use MesureIt! to measure pixels on websites, generally to check if things add up right when developing. I'm making a fluid layout right now, and would really like to do the same, but I couldn't find anything that would show me measurements in % (relative to the window). Is there anything that does this?
More posts by @Kaufman445
2 Comments
Sorted by latest first Latest Oldest Best
I have written a short javascript code that could help you:
alert( 100 / document.body.offsetWidth * document.getElementById("<YOUR_ELEMENT_ID").offsetWidth );
You have to insert in the line above the ID of the elements that you want to know the percentual width related to the window width.
You can insert this line of code in firefox url bar (preceded by "javsacript:") or in the chrome debug consolle (CTRL+SHIFT+I then find in the left bottom corner the 'Show console' icon)
I would use a calculator.
100 / screenWidth * elementWidth
But what should that be good for? The designer should set up the percentages once for the layout. Screen sizes are different, thus also the computed percentages would differ, depending on what screen size you are using such a ruler.
100 / 1600 * 900 = 56.25%
100 / 1024 * 900 = 87.89%
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.