Email or username:

Password:

Forgot your password?
1 post total
CSS by T. Afif :verified:

💡 CSS Tip!

Use modern CSS to get the width of the scrollbar. Yes it's possible, and you can have it as a CSS variable defined at :root level!

Demo: codepen.io/t_afif/pen/rNEjyNj via @codepen

Online Version: css-tip.com/scrollbar-width/

A Chrome-only experimentation (I repeat, chrome-only)

#CSS #HTML

Overview of the CSS code from the linked demo
A screenshot of the linked demo showing the value of the scrollbar width
Ana Rodrigues

@css Smart!! Now I need to find time to update an old article of mine to include this ohhelloana.blog/til-fix-scroll 😁

Go Up