and the interesting "trick" I learnt the other day for fixed/absolute positioning, if you add inset:0rem; margin: auto; it will center vertical and horizontal it without having to translate it courtesy of Kevin Powell - https://www.youtube.com/watch?v=HOM47v73yG8 ( who I've found to be an amazing resource for learning all kinds of CSS info )
Note that inset is a very recent introduction, only supported by Firefox 66+, Chrome 87+ and Safari 14.1+ (14.5+ in iOS). It will take quite a while to use it without thinking.
What does 100% mean in CSS? (2020)
21–30 of 72 posts
Re: What does 100% mean in CSS? (2020)
#22I'm a little embarrassed to admit that I've been working with this stuff for decades and I just now found out that margin and padding top is based on parent width if expressed in percentages. I'm only a little embarrassed because who expresses margins in percentages anyway.
But otherwise you’re right, it doesn’t really come up.
Re: What does 100% mean in CSS? (2020)
#23Re: What does 100% mean in CSS? (2020)
#24Re: What does 100% mean in CSS? (2020)
#25I'm a little embarrassed to admit that I've been working with this stuff for decades and I just now found out that margin and padding top is based on parent width if expressed in percentages. I'm only a little embarrassed because who expresses margins in percentages anyway.
You never needed to set some flexible containers dimensions to have some precise aspect ratio? Up until very recently [1] the "padding hack" used to be the only option… https://css-tricks.com/aspect-ratio-boxes/ [1] Recently `aspect-ratio` got into evergreen browsers: https://developer.mozilla.org/en-US/docs/Web/CSS/aspect-rati...
Re: What does 100% mean in CSS? (2020)
#26Is it only me whose "just give me the gist" button is not working and only jumping back to top of the page? (Browsing on iPhone iOS 14.6)
Re: What does 100% mean in CSS? (2020)
#27Re: What does 100% mean in CSS? (2020)
#28Damn, somebody plz develop a sane alternative to CSS.
Re: What does 100% mean in CSS? (2020)
#29This is why I knew how to be a frontend engineer at one point in life but never pursued it past the early 2000s. The brainpower wasted on web layout is immense.
Re: What does 100% mean in CSS? (2020)
#30This is why I knew how to be a frontend engineer at one point in life but never pursued it past the early 2000s. The brainpower wasted on web layout is immense.
What about UI development is a waste?
Blame it on folks outside of dev? I would ban the word “modern” if possible. Everyone thinks that it’s obvious but no one seems to be able to define it once and for all, lol