Introduction: Supercharge Your Stylesheets with These Handy CSS Tricks
Hey there, fellow UI developers! Are you ready to add some pizzaz...
For further actions, you may consider blocking this person and/or reporting abuse
A Really useful list of the snippets. Thanks for sharing.
Nowadays, centring is much easier with a flexbox and grid.
With Flexbox
With Grid
For "The Magical Centering Trick" I use:
or
I avoid using
transform
in this case for performance reasons. And when inset is supported, this is more concise.PS: Don't forget to add
position:relative
to its wrapper if you don't want it to stick to the viewport.position: relative
Yeah I like it, a couple of good tricks ...
Funny though that you're calling this "quick and dirty":
5. The Flexbox Centering Shortcut
but apparently this is "clean and elegant"?
1. The Magical Centering Trick
I would call it just the other way around ;-)
Hey just joking, I love this article!
Nice article and some great tips here.
To go along with #1 I have found that using margin helps with some pesky centering issues as well:
.center-this {
margin: 0px auto;
}
along with the parent position setting that Peter Vivo mentioned in his comment.
Nice.
But one thing, you can't change scroll speed, only scroll "behavior" is customizable.
Good css tips shared
Thank you for sharing useful tricks 🤩
Wow!, I really appreciate the way you broke down the concepts, making them easy to understand. This will definitely be helpful for both beginners and experienced developers. Looking forward to more insightful posts from you.
Handy! Thanks for sharing!
I would opt for flex with the example you gave, and therefore most snippets are obsolete. Nice part about it, might be understanding of legacy systems.
Hi Niraj Narkhede,
Thanks for sharing.
Interesting post. Thanks for the share Niraj!
For those who're looking for more, here's a great post for finding useful CSS-related tools: 80+ Best CSS Tools
Awesome, I too write similar articles
Using EchoAPI to test APIs that drive my CSS animations has made it easier to ensure everything works as expected.