don't forget to add scroll-behavior: smooth; on the element for smooth scroll animation. one line of css, no js needed!
@xeon78793 жыл бұрын
@@wolverine4489 Sadly, scroll-behaviour: smooth is not supported by safari yet.
@CoryTheSimmons3 жыл бұрын
Can someone make a CodePen of this? I can't get it working. -_-
@david-mata3 жыл бұрын
@@CoryTheSimmons Sure, I added the property to the html, body tags a higher value than the fixed nav height codepen.io/dv-mata/pen/JjEZWdM
@ste-fa-no3 жыл бұрын
@Fireship giving credit to their viewers as collaborators, AND giving them a free T-shirt: wholesome 🧡
@skyracer-mk8hg3 жыл бұрын
Those 3 guys after getting in the video and also winning a shirt gotta be proud of themselves
@skylark.kraken3 жыл бұрын
I am 😸
@skyracer-mk8hg3 жыл бұрын
@@skylark.kraken you are ;)
@bloodbrothers13133 жыл бұрын
@@skyracer-mk8hg he is!
@skylark.kraken3 жыл бұрын
@@bloodbrothers1313 She is
@nsharma49813 жыл бұрын
Getting my first comment on this channel featured in a video is nothing short of an honour, so hell yeah I'm proud! Also, not a guy :)
@krtirtho3 жыл бұрын
Is this a problem or a blessing?! Why do I like each & every video of Fireship?
@Kevin-jc1fx3 жыл бұрын
Congratulations, you have a good taste for quality content.
@justoffy.5353 жыл бұрын
100 seconds of Haskell! 100 seconds of Heroku! 100 seconds of Bootstrap! Thank you of you choose any of these!
@shk80893 жыл бұрын
100 seconds of Rust would be cool too
@justoffy.5353 жыл бұрын
@@shk8089 I wanted to write that too but i saw someone already asking for it so I didn't write it in.
@tytywuu3 жыл бұрын
100 seconds of Haskell PLEASE ~~~
@justoffy.5353 жыл бұрын
@@tytywuu I said haskell because I heard about it but i never seem to understand it.
@lars22993 жыл бұрын
HEROKU! Bootstrap too...
@Nerwesta3 жыл бұрын
HSL is a life saver when you want to enter to the realm of theming in CSS via custom properties, just tweak your hue / lightness / saturation on your root variable or even better if you want to "darken" / " lighten " something ( for instance on a :hover button ) just like the Sass function, you can do those aswell. No need to add an extra hex color property, it increases maintainbility in a large margin. Highly recommend this !
@WilsontheWolf3 жыл бұрын
Can't have enough css tips.
@richardd96343 жыл бұрын
This channel is the gift that keeps on giving and quite honestly the most informative one I've ever subscribed to. Thank you so much for all the incredibly useful content!
@bananerer3 жыл бұрын
A little heads-up to the scroll-padding trick: It doesn't work on Safari and Safari mobile (therefore it doesn't work in iOS browsers at all), so it can't be relied on for websites that should run on mobile as well.
@leoingson3 жыл бұрын
It's CSS, after all.
@jlopezg83 жыл бұрын
Safari is the new Internet Explorer
@escape07073 жыл бұрын
@@jlopezg8 I second this.
@akash-kumar7373 жыл бұрын
Yup, something is still better than Nothing.
@migueldomingos45703 жыл бұрын
@@jlopezg8 Yeah for sure. It took *ages* to finally support the flexbox gap property compared to other browsers
@faustinopedrofaustin3 жыл бұрын
I use rem and em all the time, easy way to responsive layouts
@thomaskhlebovitch61983 жыл бұрын
I don't know whether you also cover some electronics and other stuff, but could you also show 100 seconds of Assembly 100 seconds of Arduino/RaspberryPi 100 seconds of Embedded C And what would be really awesome (that might also take some more time than just 100 seconds) 100 seconds of Clean Code This would be really helpful!
@olafkliemt11453 жыл бұрын
scroll-padding is a real relief
@sullenpuffin3 жыл бұрын
Damn, scroll-padding? That’s insane, I literally needed that today! Thanks!
@adeleke51403 жыл бұрын
Hsl is the best thing I've discovered this year. Phew, it's so easy to understand colors now. I'm definitely gonna be tehjgtour Scroll padding.
@shivamgavandi26653 жыл бұрын
That last one just fixed my current project. I love my recommendations!
@Probler3 жыл бұрын
me clicking on this video faster than the speed of light,
@semrasipal7679 Жыл бұрын
😊
@dimboump3 жыл бұрын
Holy moly! Thank you for the feature!
@Brunoenribeiro3 жыл бұрын
scroll-padding-top is a game changer
@jayantjagtap29763 жыл бұрын
That scroll padding top is a live saver 🔥🔥
@adeelfitness49933 жыл бұрын
The scroll padding was something that I needed badly. You saved my life bro
@birdbrainsolutions61123 жыл бұрын
Before watching: "Meh, it's just css. How life changing could it possibly be?" After watching: "Holy shit, that just changed my life!" lol, thank you so much for creating this video!
@lakshaysharma103 жыл бұрын
Scroll padding changed my life
@angelozuniga97663 жыл бұрын
you saved my life with that scroll padding thank you so muchhhhh!
@ErrorSulake3 жыл бұрын
Oh my god the last one os AMAZING, I've spent hours trying to fix that for dynamic header sizes and responsiveness
@skyhappy3 жыл бұрын
Could you explain what it is exactly, are navbars as big as in the video? are fixed navbars bad?
@skylark.kraken3 жыл бұрын
@@skyhappy Fixed navbars are standard and while they are evil they are also necessary. Think about applications that aren't browsers, they all (that I have open currently) have fixed content usually at the top sometimes on the side. They can be ignored if the content is more important than navigating around, such as content with reading (also scrolling slightly less). However while there is no hard limit to navbar sizes if it's just navigation and logo then it should be no bigger than 2 or 3 rem (i.e. 1.75rem font size with 0.25em padding); but if you need more complex content fixed (such as for web-apps) you can make them bigger but be conscious about the size and how much space is left for the main content
@felixenghofer46163 жыл бұрын
I actually noticed that last problem today at work and wondered how that can be fixed. I'll try setting scroll-padding tomorrow :) Thanks for making such great videos Like this one!
@m3po223 жыл бұрын
The first tip is what I started doing after 2 years of web development. I liked to design while working in CSS and `em` units just made it easier to change things around.
@m3po223 жыл бұрын
If you're making a component library for external consumption, DO NOT USE REM UNITS.
@PatricioHondagneuRoig3 жыл бұрын
Scroll-padding really was nothing short of life-changing. Keep these videos coming :D
@mrbreadman3 жыл бұрын
that display: flex tshirt is amazing
@KevinVandyTech3 жыл бұрын
* { display: none; }
@sambhavjain11043 жыл бұрын
Scroll-padding is 🔥
@Glavin8833 жыл бұрын
The scroll padding trick has just saved me from writing my standard jQuery click events to handle the same problem
@planetmall23 жыл бұрын
Love that you use the community for such great updates!
@iskeyrin3 жыл бұрын
Scroll pading exploded my mind, thank you
@MattPolaniecki3 жыл бұрын
character clamp idea is brilliant. thank you
@darshannaik85583 жыл бұрын
To center a element use display : grid ; along with place-items:center ;
@AdarshSingh-qd6mq3 жыл бұрын
Scroll-padding was new for me...👍
@skylark.kraken3 жыл бұрын
Same, had no idea it existed. Here I was adding a nonsense element with the id using position relative to scoot it up.
@_modiX3 жыл бұрын
scroll padding will change my life.
@karamelizesogan3 жыл бұрын
Your videos are truly golden. Condensed gold nuggets.
@danielgiven12643 жыл бұрын
Currently doing an escape room game project for uni and some of these tips are great, thanks for your help!
@ash.mystic3 жыл бұрын
Great tip! I never knew why this happened and always compensated for it by adding extra margin/padding to the top of the element I was scrolling to. Using scroll-padding-top will be so much better!
@pronayguha70993 жыл бұрын
rem is really a life saving and scroll-padding will be an interesting one to implement
@MindlessTurtle3 жыл бұрын
Not gonna lie. Those are good tips.
@IshanKesharwani3 жыл бұрын
Woah !!! That last one was amazing. I had no idea it exists
@massimo84083 жыл бұрын
The last one was very useful
@RusuTraianCristian3 жыл бұрын
Regarding the fixed header of the website -- having a fixed positioned one will always obfuscate content so it's bad. In contrast, having a relative one is also bad if you have lots of content to scroll through, imagine you scroll down a lot and then you need the navigation that the header is providing, it means you need to scroll all the way back up. So to address this issue, in literally all of my projects, I'm using what I like to call a 'smart header'. If I scroll down, it slides up out of the view, after a threshold is met. Similarly, if I scroll up, it comes back into view, even if I'm at the bottom of a page and I scroll up a minimum of x pixels (the threshold). I'm sure lots of you know about this, it was just a reminder since it's so easily achieved with JS and even within React.
@ChandraSekhar-mz8xy3 жыл бұрын
Pro tip: Use rem as per this video. And in css create html{ font-size : 62.5% } So this will make your font size 10px , now insted of 2px use 2 rem , Benefit? -> In media query just maintain the font-size of html to 40%, according to your style and you'll have to write just very few lines of media query 😄
@yblackfrost Жыл бұрын
you can also set body{font-size:1.6rem;} to restore the default browser font size
@realgarmingo3 жыл бұрын
Real Pro's center things horizontally with the tag
@playstore-so2xm3 жыл бұрын
First of all, thank you very much for saving time with this information. Could you please continue this series at least for another three episodes?
@nukemonk3 жыл бұрын
Here's another life-changing tip: *subscribe to Fireship!* It even rhymes.
@aymanehrouch3 жыл бұрын
the hsl tip can save me a lot of time!!! thanks!
@MrCalacianu3 жыл бұрын
I find the last one very useful 👍
@adamgonzales86773 жыл бұрын
First time I've heard of scoll-padding
@avatr71093 жыл бұрын
What a generous man He's giving credit to others ..... 😥😥😥
@MaxProgramming3 жыл бұрын
200 likes and 0 dislikes. You are a true legend!
@AdamsTaiwan3 жыл бұрын
I prefer the hex format, because I store color strings in a DB and also can share nicely with WPF.
@_erfanm963 жыл бұрын
Actually, 'em' relative to the element's font size, not the parent! But since 'font-size' is an inherited property, most of the time it would be as same as the parent's font size (because we don't change it much!)
@Dominik-K3 жыл бұрын
Thanks a lot, nice tricks! I'll try to use them in my next project
@alexandrgoncharov50743 жыл бұрын
the best channel about tricks
@Mohamed-nt2hf3 жыл бұрын
100 second of *ssg* (Static Site Generation)
@sudeepkumarsatpathy61042 жыл бұрын
I wish I could tag N Sharma to thank him personally for this scroll-padding tip! And thank you Fireship for this compilation! Cheers! :)
@midtowncomics36133 жыл бұрын
The real question after watching these css videos is : Fireship and Web Dev Simplified, who is stealing from who? Or even better are they working together? (No disrespect to either, both are great channels that I subscribe to)
@fgsaldanha3 жыл бұрын
I am subscribed to both and feel my CSS knowledge has doubled in the last week
@nsharma49813 жыл бұрын
Haha, the scroll-padding-top is something I've discussed with Kyle (WDS) in the past on his discord server so I can take some of the credit for that bit of overlap in content, hah!
@albirtarsha53703 жыл бұрын
Thank you for scroll-padding! I had a less elegant work around.
@albirtarsha53703 жыл бұрын
I take it back. Scroll-padding is not so great. I thought it could be used for a fixed nav-bar to navigate to content that is parsed into sections of unequal size. My work around still reigns supreme.
@cristiansuarez13133 жыл бұрын
This is amazing! I'll use them all! Thank you
@wolfrayet813 жыл бұрын
WoW!!! i was about to deal with the bug of the 3rd tip! You were just about time :D
@paulwhiterabbit3 жыл бұрын
Flexbox/Flexgrid changed me, but I'm still surprised that a lot of people still uses px for everything even today. My tip was to keep exploring and not stick to what you already know.
@Bog0sso3 жыл бұрын
Just coming back to push the like button 🔥💯Thank u for all of these contents
@Alexey-Yoshimitsu3 жыл бұрын
Классные советы, моя жизнь изменилась до неузнаваемости, спасибо вам
@AsadIqbal-ee8vu3 жыл бұрын
Thank you very much I will try all these.
@DreadKyller3 жыл бұрын
That last trick I usually deal with via negative vertical margin and padding equal to the height of the navbar, so if the top nav bar is 24px, then I may have: margin-top: -24px; padding-top: 24px; And if I wanted 8 actual padding, I'd use 32px for the padding to move it the additional 8px. The trick in the video is a bit cleaner, though it's not as well supported as the margin+padding trick.
@cro-guy3 жыл бұрын
Or just use position:sticky to avoid all those hacks
@skylark.kraken3 жыл бұрын
I would have an element that had no purpose other than to have the id and would use position relative to scoot it up 😹
@kettenbach3 жыл бұрын
Best web dev channel on youtube imo. 😍🙏
@usernamechangeinprogress3 жыл бұрын
100 seconds of Coq 100 seconds of Verilog 100 seconds of Pytorch u lit fam much love thank you so much 🔥❤️😛
@albertsun33933 жыл бұрын
Verilog in 100 seconds? Uhhhhhh
@ashkanahmadi3 жыл бұрын
Would be cool if someone made a video or compiled all those css tips in the comments of the previous video
@jenniferward68213 жыл бұрын
Love the para one
@somebrid21473 жыл бұрын
Congrats to the people with the free T-Shirts.
@jebenobesmrtanbatica80853 жыл бұрын
i love css so much
@gabrielkarczewski44533 жыл бұрын
The first point is incorrect. Em and REM are responsive units, but they respond to the browser font size, hence they should only be used on text and things that depend on text. If someone changes the font size in the browser and goes on a website that only uses REM, the site will be all zoomed instead of having larger text. Please do not encourage incorrect usage of em and rem.
@AlexSpieslechner3 жыл бұрын
yesss more css tips. too many frontend devs skip over css
@itsjoseluis3 жыл бұрын
This just saved me 20+ hours
@Carlosgzz933 жыл бұрын
scroll padding how com I never knew that one, last project i had to do a func to calulate the height of my nav and remove that from the scroller.
@nerothos3 жыл бұрын
Unfortunately, 45 ch does not actually equal 45 characters. It equals the width of 45 zeroes in that typeface. For a monospaced font that works perfectly, but for anything else your results may vary and it's not a foolproof way to follow the mentioned guidelines. Worst case scenario; count the amount of characters you end up with on one line and adjust your ch value based on that. Or don't because it's probably close enough :P
@TheGawel913 жыл бұрын
I love those short videos, nice work as always.
@MrRobotUy3 жыл бұрын
Awesome, the first one is the one that I needed!
@oskrm3 жыл бұрын
scroll-padding doesn't work well with safari (the new IE)
@ilijailicic47023 жыл бұрын
Your CSS tips are life-saving stuff! =)))
@siggy56873 жыл бұрын
Pleae keep posting these! Great videos!
@niteshkrsah22223 жыл бұрын
You contents are really awesome Thank you for your hardwork and free contents.
@vanviethieuanh22373 жыл бұрын
💖 scroll padding
@loading00043 жыл бұрын
100 seconds of quantum computing please i need this
@Viralvlogvideos3 жыл бұрын
please make a video on most used css elements
@verified_tinker18183 жыл бұрын
100 seconds of Heroku sounds good! Also 100 second of Rust, if it's used in the web field.
@lucasfelipe-ze5sy3 жыл бұрын
Thanks! Please, make more css videos
@joaocesarlima73393 жыл бұрын
Wow! I wish I had discovered this ch unit before! Better yet mixed with clamp! :O
@Rakesh-jz1zf3 жыл бұрын
Very informative, thanks for the video.
@sherwing90543 жыл бұрын
If only I knew these tips earlier, I could've saved like 2 weeks of QA from my student capstone project.
@robertotonino29163 жыл бұрын
Great video as always! Is there a store where we can buy that t-shirt? 👀
@MM-vr8rj3 жыл бұрын
Often you still need media queries for things like font-sizes despite using REM or EM or even VH/VW but I can imagine that it takes more media queries if you use PX
@beckybeck38883 жыл бұрын
As always great and valuable content. Thank you!
@21agdmnm3 жыл бұрын
DANG these tips are soo cool!! anybody knows any blogs/articles where I can find more??
@pixiedev3 жыл бұрын
Don't forget 100 seconds of yoga 🤣️ because you are investing many hours for 100 seconds 👍️.