You can do more than I did here, including styling the up and down arrow buttons, the empty spaces on the top and bottom, and more! developer.mozilla.org/en-US/docs/Web/CSS/::-webkit-scrollbar
@Stoney_Eagle3 жыл бұрын
Me: Opens Mozilla link in Firefox... Also me: Remembers ::webkit-*....
@risingson76813 жыл бұрын
Thank you for this. By now i never got it running on ff.
@wittywolk2 жыл бұрын
We can't force this scrollbar to stay visible on mobile (ios or firefox on android) without using custom JS scrollbar right? I mean we can somehow trick that website is going 1px down and up all the time but it can cause problems. What do you think?
@Creative.K2 жыл бұрын
Hi, @Kevin Powell. How do we get the hsl to have transparency?
@Melksh13 жыл бұрын
I love how you actually demonstrate multiple options instead of just a plain tutorial.
@Gregorius4213 жыл бұрын
@Ahmad Bilal Yes, demonstrating the different possibilities is what hooked me to Kevin's videos. There's always something new I haven't thought of or knew about.
@Melksh13 жыл бұрын
@@Gregorius421 yep and it is a pretty unique style. I don't find many people doing this. I get to learn so much due to this. 🙌
@zachjensz3 жыл бұрын
This really raises the bar for scrolling
@thobbs1026703 жыл бұрын
kzbin.info/www/bejne/pYTLhX1vZct2aZY
@a-fletcher3 жыл бұрын
Well that's enough dad jokes for this morning 😆
@MarjoForcado3 жыл бұрын
Ahhh humor 💀
@chomo54andbabyaisha973 жыл бұрын
1998: Microsoft: Style your own scoll bars! 2001: N&N Usability test: Custom scroll bars are bad for usability 2021: W3C: Style your own scroll bars!
@bradhaupt12613 жыл бұрын
Thank you for your contribution to humanity
@KiwisCode10 ай бұрын
While working on my portfolio project around 1 AM, I stumbled upon this video on how to beautify my scrollbar, and it's amazing! I'm really happy that you paid attention to these kinds of details. It was truly helpful and came just in time for me.
@FatherlessTrashTalker8 ай бұрын
SAME BRO LOL its 12:30 PM/0:30AM rn
@_ap__3 жыл бұрын
I love Kevin's professionalism and premium style tutorials.
@KevinPowell3 жыл бұрын
Thanks Akash!
@tapank4153 жыл бұрын
Nice Last Name!!! ;)
@graaam1013 жыл бұрын
6:36 "vertical-scroll" - affects the bit that scrolls horizontally 🤣 Pretty sure that is right out of my playbook of goofs!
@Dexter101x3 жыл бұрын
I thought I had misheard it, but yeah people do make mistakes
@keithf52363 жыл бұрын
so is the horizontal scroll actually referred to as vertical bc when you put vertical-scroll, it only affected the horizontal?
@conceptrat3 жыл бұрын
@@keithf5236 Kevin has defined a class of vertical-scroll for specific divs/blocks of content that will be scrollable but the overflow attribute means that the one shown is actually only presenting a horizontally scrollable area. Hence the confusion.
@domenicpolsoni83703 жыл бұрын
I'm a simple man. I see a new video by Kevin, I watch and upvote.
@MarcHoekstra3 жыл бұрын
You can use a transparent border in combination with "background-clip: content-box;" to move the scrollbar away from the side. In combination with "overflow: overlay;" on your html element this looks great, even if your page background isn't a static color!
@gomitchell3 жыл бұрын
Any chance you have a codepen example?
@jdlowen2 жыл бұрын
CSS has evolved so much... what is your recommendation to learn the essential basics and the latest useful tricks. PS: of all the KZbinrs, I find you the most useful. Big thanks and keep it the great content. The fact that your screenshot show the final product and you describe what will be accomplish is what attracts me the most to your videos..
@adityasagar90782 жыл бұрын
So easy to understand and so professional,you made my website look good
@candym52803 жыл бұрын
CSS never ceases to amaze me
@jonmayer2 жыл бұрын
5:19 right there, if you freeze you can see it. You CAN do a margin-inline on the scrollbar-track. It just only affects the horizontal scrollbars and not the vertical ones.
@xblxckxpxny10052 жыл бұрын
great catch!
@juditturcsanyi66403 жыл бұрын
Great video (as always)! The Firefox part is exactly what I needed today 🙏
@vin-kry3 жыл бұрын
I was looking for a video for scrollbar, And suddenly a notification popped with your video. Thank you ^_^
@nextentrepreneur92883 жыл бұрын
Really ? I've heard that so many times, soooo unlikely...
@vin-kry3 жыл бұрын
@@nextentrepreneur9288 Yes really, For SURE!!!
@ranjoyguhathakurata56503 жыл бұрын
hey Kevin I love you. You dont know how good you are.Superb teacher. So much skill in css.Truely CSS king.Learned a lot from your videos and keep learning.
@sharakpl3 жыл бұрын
10:58 sometimes you want a block or even whole page scrolled but without the feeling of page being scrolled. That's where hiding (not disabling) scrollbars comes in handy. Thanks for another great video! I've just been looking for a scrollbar customization in new themes, but couldn't find good enough cross-browser way.
@KevinPowell3 жыл бұрын
Yeah, good point I should have thought of that :)
@yTheuszss8 ай бұрын
Hi man, you saved me from a mess I was in for hours, thank you
@AttackHelicopter643 жыл бұрын
5:55 you can also have transparent border for thumb combined with background-clip: padding-box so you don't have to care about track color, if you just want to have "padding" for thumb
@AttackHelicopter643 жыл бұрын
+ having :hover style, that removes border, so thumb grows when you hover over it
@ighsight3 жыл бұрын
Timely input by the algorithm, was struggling with this yesterday.
@tayyabnoor74713 жыл бұрын
Every front end developer should watch this video
@r3pwn-dev3 жыл бұрын
Fun fact: in addition to :hover, you can also use :active on the thumb to style it differently (make it even darker) when the user's mouse button is pressed
@carolmckay51523 жыл бұрын
Thankyou for revisiting this topic but with MORE, I decided to style the chrome scrollbar to look like the firefox scrollbar which looks heaps better in my arrogant opinion. ::-webkit-scrollbar { width: 12px; height: 12px; } ::-webkit-scrollbar-button { height: 0; } ::-webkit-scrollbar-thumb { border-radius: 100vw; border: 3px solid; }
@Glow0110 Жыл бұрын
Such a great, straightforward video
@Bobnator53 жыл бұрын
Awesome video man! You make it so easy to understand
@CodingAfterThirty3 жыл бұрын
Nice. The exact video I was looking for.
@MichaelHitzelberger3 жыл бұрын
Nice video, thanks! What got me confused a bit: Your 'vertical' scroll is actually a horizontal one. 😕
@KevinPowell3 жыл бұрын
🤦♂️
@The14Some111 ай бұрын
@@KevinPowell still not got used to this? :)
@thefaulenzer6773 жыл бұрын
Thank you so much! I really enjoy watching your videos to learn something new :D
@BrianHHough3 жыл бұрын
This is a fantastic tutorial, thank you for making this!! Helped me so much!
@dave60123 жыл бұрын
I thought I was crazy for doing this on all my sites, but now I am validated 😀
@rnwonder1073 жыл бұрын
Amazing stuff as always, thanks a bunch for this, I learnt a lot!
@gusober46733 жыл бұрын
I learn so much with kevin powell, thanks
@CristianAlexandruRadu3 жыл бұрын
I love your tutorials, Kevin ❤️
@sujanbasnet78683 жыл бұрын
Super insightful video. Thanks Kevin.
@akifahmed9610 Жыл бұрын
Very informative video. I was looking for customising scroll bar and stumbled upon this video 😁
@Gregorius4213 жыл бұрын
6:00 neat trick for transparent thumb border, needed if the track's background is a gradient or image: border: .25em solid transparent; background-clip: padding-box;
@DaCheat1003 жыл бұрын
Hate to be maintaining that code after him only to find out that the ‘.vertical-scroll’ class is responsible for the horizontal scroll bars instead 😂
@ЯМолодец-ъ6ш3 жыл бұрын
There is another one useful property ::-webkit-scrollbar-button. It could be pretty helpful to hide controls.
@fittersitter3 жыл бұрын
I remember that this was once possible in IE too. It's a nice to know. But my experience is that in most cases it isn't a good idea to change the browser UI. It disturbes the site visitors more than it improves the usability.
@chomo54andbabyaisha973 жыл бұрын
I just wrote the same thing before I read this, so there must be many who remembers the scroll bar hell which came with other fun stuff like scrolling text, auto starting music. comic sans, ani gifs and "Best viewed in 680*400 with IE". History repeats itself unless we know the history and learn from it
@TheStickofWar3 жыл бұрын
Yeah, I think this is more applicable for web apps than websites. I can see that at work making a custom scrollbar would make our inner charts that scroll a lot nicer, but I dont think I would do it on a ecommerce site for example.
@herion052 жыл бұрын
I use this for horizontal scrollers. But for the vertical scrollbar people are so used to the default one that it would be disturbing to change it.
@ALex-ts1gu11 ай бұрын
When I use the code, the Chrome style is no longer applied. It worked until recently. I think because of the new support for "scrollbar-width". / Style Scrollbar works on Chrome, Edge, and Safari ::-webkit-scrollbar { height: var(--scrollbar-height); /* height of horizontal scrollbar */ width: var(--scrollbar-width); /* width of vertical scrollbar */ } /* Track */ ::-webkit-scrollbar-track { background: var(--scrollbar-track); } /* Handle */ ::-webkit-scrollbar-thumb { background: var(--scrollbar-thumb); } /* Handle on hover */ ::-webkit-scrollbar-thumb:hover { background: #808080; } /* Scrollbar corner */ ::-webkit-scrollbar-corner { background: var(--scrollbar-track); } // Scrollbar for Firefox * { scrollbar-width: thin; scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track); } ---------------------------------- I changed it to from this: * { scrollbar-width: thin; scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track); } to this: /* Browsers without `::-webkit-scrollbar-*` support */ @supports (not selector(::-webkit-scrollbar)) { * { scrollbar-width: thin; scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track); } } now it works again.
@BabyBedtimeASMR3 жыл бұрын
Great video can’t wait to try this!
@chinmayghule82722 жыл бұрын
You can hide your scrollbar on Chrome by enabling the scroll-overlay flag. The scrollbar doesn't go away permanently, it just hides, If you place your mouse on the right edge of the screen it reappears. Also, the new scrollbar that the flag displays is thin and more stylish than the default one. Without the scrollbar websites look much better.
@RaveKev3 жыл бұрын
Danke!
@KevinPowell3 жыл бұрын
Thanks so much, Kevin! (and great name 😉)
@Ddalu53 жыл бұрын
Ehrenmann 👍
@RaveKev3 жыл бұрын
@@Ddalu5 Danke :)
@creativereasons75883 жыл бұрын
The amount of times you drop content related to my current problem is slightly concerning.. You're a wizard..... 'Harry'.
@roskildekille89722 жыл бұрын
Awesome! This really helped me :D
@sabiruli3 жыл бұрын
You are really great, man! I like it.
@AbWischBar3 жыл бұрын
Was about to type “ha, first time ahead of you” when you started to show the Firefox hack 🤪. A pity Firefox doesn’t allow the full monty (one of my favorit browsers) but then you could use width = none and fake the scrollbar with a home made one (div in div and some javascript). Some might say that’s overkill, but to me unstyled scroll bars always visually pop out (mainly an issue since I am mostly a desktop XAML developer where you can style everything to fit perfectly together)
@ashish_prajapati_tr3 жыл бұрын
another thing, that i was trying to implement it on my projects.
@aaaliii4u Жыл бұрын
Awesome Kevin!
@DamianWalczak3 жыл бұрын
ohh this is what I wanted Thank You Very Much!
@zqarb2 жыл бұрын
Thank you, this really helped me.
@SuperSurreal9 күн бұрын
So helpful, thank you!
@nomad73172 жыл бұрын
Thank you!!! You are a life saver!!!
@YxK1122 жыл бұрын
the explanation was unique
@MyPersonalChannel772 жыл бұрын
Hi Kevin. I have a question about the vertical scrolling. The vertical scrolling inside the document, why is called vertical? Because to me, it looks like horizontal. Thanks
@nivethan_me2 жыл бұрын
same doubt isn't it horizontal!
@shanehenderson80373 жыл бұрын
Tried this out and worked great! I noticed my scroll bars in Firefox had rounded corners though too, so it must’ve worked!
@IguanaDJ13 жыл бұрын
Hi Kevin! Great video as always! I was wondering what fonts do you use and where can I get them? They seem very cool! Keep with the great content!
@KevinPowell3 жыл бұрын
Most of my demos use Google Fonts :)
@Gregorius4213 жыл бұрын
It's there in the codepen. For this tutorial it is: --ff-body: "Heebo", sans-serif; --ff-heading: "Oswald", sans-serif;
@allan_archie3 жыл бұрын
Been looking for this.
@Leyksnal3 жыл бұрын
Thanks man.... I really appreciate this
@lumynou59 ай бұрын
Chrome now supports the `scroll-*` properties, though these cannot change things like border radius, but I actually think it's better because in my opinion, custom scrollbars sometimes bring a bad accessibility and changing the color is enough in most case.
@rafaelveggi3 жыл бұрын
Great video, as always, thanks for the content! Sad thing we still can't make scrolbars to expand on hover to this day and age...
@guillermoandradaFSD3 жыл бұрын
I find your vids really usefull
@DamnDealDone3 жыл бұрын
How about don't mess with scrollbars? Best advice for web design anyone could ever have when it comes to scroll bars.
@stefanpfadt43537 ай бұрын
Perfect timing! Thakns KZbin algorithm :) Just bit bummed, I cannot get Firefox to look anyhitng like that. Does it work only for Edge and Chrome?
@antonpetrov1453 жыл бұрын
Why do you call the horizontal scrollbar - vertical? Awesome video as always.
@KevinPowell3 жыл бұрын
Because I *always* mix them up, lol
@jeroenrnl3 жыл бұрын
@@KevinPowell very easy mnemonic: horizontal is how the horizon is positioned* * Disclaimer: doesn't work after too many beers
@SuggonM Жыл бұрын
2:49 that joke caught me off-guard
@DavePatrick2 жыл бұрын
Helpful video as ever. I have an issue with custom scrollbars that I can't find an answer to. I often use on horizontal media scroller (you've done a video on that which is great). The problem I find though is that media scrollers will always have an overflow. But, without custom CSS for the scrollbar in an overflow:auto area, a scrollbars will only be visible when you hover on the area (on Mac and mobile devices). However when you implement custom CSS this changes and the scrollbar is ALWAYS visible. I find this ugly and non desirable, my clients and designers don't like it and tell me to get rid of it. I say that I can't because I haven't found a way! It looks bad especially when you consider often these media scrollers have padding on the left to align the first slide. Now, I would be happy with the default behaviour and would not want to use custom scrollbar CSS like you've demonstrated here, however the MAIN reason I customise the scrollbar is to get rid of the ugly Windows blocky scrollbars that you get in Chrome and Edge. Is there anything I can do, that would target the browsers that have an awful looking scrollbar? I can't think of anything atm.
@ed1nh03 жыл бұрын
Kevin I really wish you could approach the :hover state with the width property, so we can get thin scrollbars and thicker when hovering it!
@hafizurrahman53413 жыл бұрын
What you do, is always interesting....♥️♥️
@Hytension2 жыл бұрын
I'm just happy opera supports webkit
@pw.706 ай бұрын
Hi Kevin - quick question about this - is there anyway to capture the drag using CSS (i.e. when dragging the thumb -slider)? I was looking to have a grab effect running, so open hand while over the top of the thumb-slider, and closed while dragging? Thanks in advance, if you see my post. I did look down the pseudos and what-have-you, but couldn't see anything obvious.
@blokche_dev3 жыл бұрын
I was going to ask how to style the intersection of the vertical and horizontal bars but the mozilla documentation covers that =>::webkit-scrollbar-corner. 👍
@bikinglikebecker Жыл бұрын
save: to playlist -> is not functioning on this video so unable to add to playlist.. fyi.. I presume integrating this into the style(index).css file? How do we make it so we can click on the page(not scrollbar) & move it up like a mac instead of scroll wheel? great stuff you are teaching & sharing... something we should all do with the knowledge that was shared with us by others... Concise & Articulated. Very easy to follow along & understand!
@monuchouhan83113 жыл бұрын
That's beautiful!
@MaherNoureddine-co9cs6 ай бұрын
very interessting ! thanks u save my life
@MichaelSpellacy20 күн бұрын
Nice video. A cleaner way to handle support now might be with something like @supports selector(::-webkit-scrollbar) { ... your webkit stuff ... }.
@michaelnorton66303 жыл бұрын
Thank-you Kevin - great video as always!!👍🏻Could you also do a video on changing the header colours on mobile browers please? I've currently got this implemented on one of my sites, but not sure if there is any extra values I'm missing?!🤔
@KevinPowell3 жыл бұрын
I'll keep the suggestion in mind :)
@UmarJAN-bz2nq15 күн бұрын
How do I keep the scrollbar scrolled down, like when the user lands on the page they have to scroll up to see the content?
@baykus790 Жыл бұрын
Can you somehow make the thumb flat at the top to avoid that 4:11 ugliness. Like if you scroll it down it becomes round, and flat when it touches the top, that sort of animation. Not sure if this requires JS but really appreciate if you show it in a shorts video or an actual tutorial...
@anais3809 ай бұрын
Merci beaucoup pour cette vidéo très claire 🤩 je suis en train de faire mon portfolio et je voulais simplement un meilleur design et grâce à vous c'est parfait ! +1
@reignsvicky3 жыл бұрын
New thing learned today 🤩
@Stoney_Eagle3 жыл бұрын
I never went this far in customizing them hehe. I have one that has no height on mobile where the desktop has a custom button controled scroll, too bad Firefox doesn't support exact sized bars. It does work with my hsl theme slider 😁😁😁
@mufeezhanif2 жыл бұрын
Nice explained..!
@iroshanaravishan13882 жыл бұрын
Wow.. thanks.. it works perfectly🤩🙌🏁
@dixztube2 жыл бұрын
I’m having issues with edge showing the scroll even when the window isn’t active. Seems like Firefox makes it hide till being used
@hkfalguni28602 жыл бұрын
Hi Kevin really nice video , covered most of them, I really wanted to know if we can change the color of the scroll bar on scrolling (not clicking and dragging just scrolling in the body of the page)
@VasilyPavlik3 жыл бұрын
Good topic as usual, Kevin. But you forgot about arrows. They could be also styled.
@qsaification3 жыл бұрын
8:38 where did you get that info? Is there a website or something?
@Evan_evan58832 жыл бұрын
Wow very nice video :)
2 жыл бұрын
In my personal experience, I think it's ridiculous that we can't customize the scrollbar any easier than using the browser prefix. I mean, why can't some styles be applied to this HTML element? So the solution for most cases is to use external libraries to customize these elements and not all of them work as expected, that's my experience. thanks for this video, great content, and very interesting topics! (P.S. sorry if my English is not good enough :P)
@brokensythe3 жыл бұрын
Fantastic video
@gunjanshrimali26742 жыл бұрын
very nice tutorial
@djelasrca80914 ай бұрын
How to make scrollbar not pushing the content to the left. Can it have something like position absolute
@CivilThinking2 жыл бұрын
It's not working in my chrome. It keeps displaying default scrollbar :/ :'(
@nugo60823 жыл бұрын
So awesome, thank you
@jabeztadesse5 ай бұрын
I wanted to "move" or atleast simulate the entire scroll bar a little to the left, can that be achieved? And if so how?
@lonewolfcoding52082 жыл бұрын
can you create a table with border radius with horzontal and vertical scrollbar and the headers are fixed?
@UdaraDeraniyagala3 жыл бұрын
As an intern It was a nightmare for me get the scrollbars look the exact same on Chrome, Firefox and the old Edge browsers with the design I got from my seniors. Ended up using nicescroll lol.
@MKgobe3 жыл бұрын
Finally... My scrollbara where just missing that @supports,
@KentaroxKondo Жыл бұрын
How can I change the cursor design to pointer when hovering the scrollbar thumb?
@arifqasim777711 ай бұрын
can we also change the height of thumb ? and I love your videos..