How many times have you wondered what 100% means in this context? Maybe not as many as this
in JavaScript ;), but it’s worth getting to know it better once and for all (or at least having a quick cheatsheet).
CSS property | Percentage value meaning |
---|---|
height | % of parent’s height |
width | % of parent’s width |
top | % of parent’s height |
left | % of parent’s width |
margin-top | % of parent’s width |
margin-left | % of parent’s width |
padding-top | % of parent’s width |
padding-left | % of parent’s width |
translate-top | % of self’s height |
translate-left | % of self’s width |
Share
Thanks for reading. If you liked it, consider sharing it with friends via:
Let's be in touch!
Don't miss other useful posts. Level up your skills with useful UX, web development, and productivity tips via e-mail.
Comments
If you want to comment, write a post on social media and @mention me. You can also write to me directly on the contact page.