Open jackherizsmith opened 3 years ago
Also I'm interested in using the viewport width to define an element's height. What was the thinking here?
I find vw more predictable than vh and the original thinking behind it was that both height and width were defined in terms in vw in order to square the element (i.e. have the same width and height)!
There are a lot different units in use and I think you might find it easier to go with one by default and then sparingly use others as and when you need to. My advice would be to use
rem
for everything, orem
when the layout of a given element depends its font size.This is a long article but one I found really helpful to understand how these can be used most effectively in combination.
Then for the most part, with flexbox and grid available, there is not much need for % which can sometimes cause issues.