fac20 / Week-1-PartyWave-CEFG

Week 1 Project - Digital Agency
https://fac20.github.io/Week-1-PartyWave-CEFG/
0 stars 1 forks source link

CSS units #26

Open jackherizsmith opened 3 years ago

jackherizsmith commented 3 years ago

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, or em 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.

jackherizsmith commented 3 years ago

Also I'm interested in using the viewport width to define an element's height. What was the thinking here?

https://github.com/fac20/Week-1-PartyWave-CEFG/blob/fbb02bbbf5216f4560b3461e09b366b9e818b7e1/style.css#L118

LiCern commented 3 years ago

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)!