Mobile app version of vmapp.org
Login or Join
Kaufman445

: 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

@Kaufman445

Posted in: #Layout #ScreenSize #Tools

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?

10.02% popularity Vote Up Vote Down


Login to follow query

More posts by @Kaufman445

2 Comments

Sorted by latest first Latest Oldest Best

 

@BetL925

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)

10% popularity Vote Up Vote Down


 

@Murray432

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%

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme