An Interest In:
Web News this Week
- November 20, 2023
- November 19, 2023
- November 18, 2023
- November 17, 2023
- November 16, 2023
- November 15, 2023
- November 14, 2023
My 5 favorite tips to improve your CSS
Hey folks!
CSS is magic for a lot of people. So I'm here to help. I wrote this article with my favorite tips. If you like it you'll read more tips in my newsletter.
border
helps users with photosensitivity to find element boundaries
background
doesn't display with operating system contrast settings enabled. As a result, users won't element boundaries. The solution is to use border: 1px solid transparent
The power of CSS inheritance when defining line-height
Folks, I messed up. I forgot I can use CSS inheritance and add line-height
to <body>
instead of adding it to <p>
, <h*>
, <ul>
, et al. separately
Don't forget to stop page scrolling when creating a custom scrollbar
Do you make the widget with custom scrolling? overscroll-behavior
will care about your users by stopping page scrolling after scrolling your widget
We don't need to use 0
anymore to define margins and paddings
I had to make a not logical thing, i.e. use 0 to define margins, paddings with opposite sides Now margin-block
, margin-inline
, padding-block
, padding-inline
help us to make the same without 0
Its time to use a new way for centering elements with position: absolute
Do you still use the old snippet to the center element with position: absolute
using transform(-50%, -50%)
? Its time to use a new alternative! Meet place-items: center
Original Link: https://dev.to/melnik909/5-my-favorite-tops-to-improve-your-css-1p4p

Dev To

More About this Source Visit Dev To