10 CSS Pro Tips - Code this, NOT that!

  Рет қаралды 2,103,380

Fireship

Fireship

Күн бұрын

Top 10 CSS Pro Tips to make your life as a web developer more productive. Some of the best programmers say CSS is too hard… but you might be surprised at how modern techniques can dramatically improve your code. fireship.io/tags/css/
00:00 CSS is too hard (myth)
00:56 1. Learn the box model
02:00 2. Firefox is Amazeballs
02:31 3. Flexbox is Fantastic
03:34 4. Grid is Great
04:23 5. Clamp it Down
05:09 Bonus: Impress your Boss
05:30 6. Aspect Ratio One-Liner
06:01 7. Variables for variables
06:46 8. Fancy Calculations
07:38 9. State Management Counter
08:18 10. Finding focus-within
09:01 Bonus: Treat an Incurable Disease
#css #learntocode #top10
Box Model developer.mozilla.org/en-US/d...
Focus-within CSS dropdown fireship.io/snippets/basic-cs...
Install the quiz app 🤓
iOS itunes.apple.com/us/app/fires...
Android play.google.com/store/apps/de...
Upgrade to Fireship PRO at fireship.io/pro
Use code lORhwXd2 for 25% off your first payment.
My VS Code Theme
- Atom One Dark
- vscode-icons
- Fira Code Font

Пікірлер: 2 100
@Fireship
@Fireship 3 жыл бұрын
Find out if you won a free T-shirt, plus 3 more free tips 👉 kzbin.info/www/bejne/gIS4g62GhtOeopI
@Asia_Bangladesh
@Asia_Bangladesh 3 жыл бұрын
How to debug code give some tips
@sumitmaiti1405
@sumitmaiti1405 2 жыл бұрын
Which type of code if you want to run html css in vscode install live server
@patrickluka8513
@patrickluka8513 2 жыл бұрын
Dont know if anyone cares but if you are bored like me during the covid times you can watch pretty much all the latest movies and series on instaflixxer. Have been streaming with my brother for the last few months =)
@wesleyalvin3308
@wesleyalvin3308 2 жыл бұрын
@Patrick Luka Yea, I've been using InstaFlixxer for since november myself :)
@emonymph6911
@emonymph6911 2 жыл бұрын
Why do people bother with SASS over SCSS? Isn't it better that whatever you write in SCSS can be reused in small CSS snippets as well if you want to in the future?
@chamomilemasone5100
@chamomilemasone5100 3 жыл бұрын
I can’t believe this is the first time I’m hearing about clamp()
@Fireship
@Fireship 3 жыл бұрын
You've been missing out, probably the best thing in this video.
@Sejiko
@Sejiko 3 жыл бұрын
Me too!
@i.am.rossalex
@i.am.rossalex 3 жыл бұрын
I use all of these... except clamp too :))))
@hamza_omari
@hamza_omari 3 жыл бұрын
Note : Not supported in IE11
@martinn.6082
@martinn.6082 3 жыл бұрын
@@hamza_omari eeeehh....
@abcdefg-nu4xj
@abcdefg-nu4xj 3 жыл бұрын
i consider myself pretty good at CSS but i didn't know about the focus-within pseudo class and clamp(). this is amazing, my mind is blown
@doublemarvellous5525
@doublemarvellous5525 2 жыл бұрын
Safari cries with clamp
@falconarea
@falconarea 2 жыл бұрын
Same here
@jude_I
@jude_I 2 жыл бұрын
I'd also like to be as good at CSS as you bro. I'd like to get helpful materials from you (materials that can help me get better at CSS), that's if you some and you if you don't mind..... what's your social media bro (Instagram or Twitter) so I can hit you up
@acme_gamers
@acme_gamers 2 жыл бұрын
ikr :')
@badplayer4348
@badplayer4348 2 жыл бұрын
Same.. also didn't know about these two specifically
@robertszordykowski4919
@robertszordykowski4919 Жыл бұрын
You explained grid in 50 seconds more comprehensibly than other tuts do in an hour. Hats off.
@jomy10-games
@jomy10-games 3 жыл бұрын
“Is that a good idea? I don’t know” That line really got me
@ezeeok
@ezeeok 3 жыл бұрын
I can't believe the amount of valuable information that you explain in less than 10 minutes, amazing job as always!!
@paxnene
@paxnene 2 жыл бұрын
I was thinking that too...
@bhumika6060
@bhumika6060 Жыл бұрын
Awesome👍
@ReligionAndMaterialismDebunked
@ReligionAndMaterialismDebunked Жыл бұрын
Fr! :3
@marangponto9560
@marangponto9560 7 ай бұрын
how does one use emojis ?
@muhammadsaadmansoor7777
@muhammadsaadmansoor7777 5 ай бұрын
indeed this was a useful video
@shreym03
@shreym03 3 жыл бұрын
A CSS Tip I learnt a long time ago was to always design mobile first. If you look at your plain HTML in mobile mode, it usually is perfectly designed moulded for a mobile setting. As you grow bigger, it’s easier to adjust all the content using “min-width” media query. The mobile first is helpful in most cases when designing.
@elgatonegro1703
@elgatonegro1703 Жыл бұрын
Good tip- plus if you're doing a professional project usually you have some kind of analytics to see how many users access the site/use the app on mobile vs desktop, etc, so you can kind of decide what should be the 'main' look and what should be a screen-adjusted layout of that. Also fwiw for anyone this might help, and based on a thing that I definitely didn't recently have to deal with- don't procrastinate your media queries to doing them all at once after you style your pages/components; if you can, try to do all or as much of you can of them for each component as you develop its styles. Sometimes you get lucky and can just set a container width to like 50/60/70vw and good ol margin 0 auto, but sometimes you can have something like a thing that I definitely didn't recently have to deal with where you're like 'wtf subheader why do you keep escaping through the container's border on xl screens??' Plus if resize media queries are a thing your app needs, they're a lot easier to manage one page/component/feature at a time. ETA: I once did something I was really pleased with where I looped through list items to grab their ID then assign that value to the content property of a before pseudoelement as a way to number things and style the number, and now I feel like a tit after having seen that counter thing.
@svenyboyyt2304
@svenyboyyt2304 Жыл бұрын
Phones tend to be slower too and the layout is simpler and more one dimensional. It's much easier to add things than trying to remove them.
@Linuxdirk
@Linuxdirk 11 ай бұрын
Mobile first isn’t even a thing anymore, since mobile screens got so big. Design in a way that the style automatically adapts to the viewport.
@Optable
@Optable 11 ай бұрын
@@Linuxdirk aka rEsPoNsIvE 🥴
@Linuxdirk
@Linuxdirk 11 ай бұрын
@@Optable Not even that. Just don’t have breakpoints.
@FlockofSmeagles
@FlockofSmeagles 2 жыл бұрын
You made me appreciate the fact that I learned the box model in the beginning. I couldn't imagine designing a page without that freedom.
@BestNoobHello
@BestNoobHello Жыл бұрын
A minor mistake at 2:45 that might get some beginners confused is that the CSS shown on the screen does not put the element (the poop icon in this case) at the bottom right of the container (i.e. the first absolutely or relatively positioned parent element, so not necessary its direct parent). It puts the top-left corner of the element at the center of the container, so now the element's position within the container is slightly off and not exactly at the center. That's why we need the specify the `transform: translate(-50%, -50%);` property which moves the element upwards by 50% of its height, along the Y-axis and leftwards by 50% of its width, along the X-axis, thus properly puts it right at the center of the container.
@randythoams
@randythoams Жыл бұрын
U R a life saver
@shinycascade8862
@shinycascade8862 Жыл бұрын
I remember when I was first trying to play with positions, and always wondered "why does this put it in so weird place, and not in the center, if I described that it should have moved it 50% from left and 50% from top? wouldn't this mean it's equal so then center?" lmao
@Mel-mu8ox
@Mel-mu8ox Жыл бұрын
I'm a noob XD this did confuse me. I'm so glad I read comments :D Thank you xx
@nayankumarbarwa4317
@nayankumarbarwa4317 Жыл бұрын
I had zero idea few seconds ago. Thanks buddy you explained it very well
@dgh25
@dgh25 Жыл бұрын
nice
@nsharma4981
@nsharma4981 3 жыл бұрын
Greatt video as always! Here's my favourite CSS Pro Tip: There's this obscure CSS property called scroll-padding-top. When you have a sticky / fixed header, and you click an anchor link, it gets hidden under the sticky header. To avoid this annoying bug, just give your body element scroll-padding-top equal to the header height. Along with scroll-behaviour: smooth, this will make it so that when you click an anchor link, it'll scroll to it, such that it starts right beneath the header instead of hidden under it, which is the intended behaviour!
@Fireship
@Fireship 3 жыл бұрын
TIL! Very cool :)
@meronogbai
@meronogbai 3 жыл бұрын
I remember manually adjusting the padding of my anchor link destinations to fix this issue on one of my sites. This is an amazing solution that will serve me well. Thanks a lot!!
@jacoblockwood4034
@jacoblockwood4034 3 жыл бұрын
Oh my god, I never new this! thank you so much!
@mattshnoop
@mattshnoop 3 жыл бұрын
This saved my ass recently on a job. 10/10 One of the best newer properties!
@jacobstamm
@jacobstamm 3 жыл бұрын
Great tip! Do you know if this plays nice with JavaScript methods like window.scrollIntoView(), or is this only for auto-scrolling using IDs?
@weshuiz1325
@weshuiz1325 3 жыл бұрын
.titanic { float: none: }
@dsi-films1264
@dsi-films1264 3 жыл бұрын
*based on a true story*
@galo7486
@galo7486 3 жыл бұрын
Xd
@AndiKod
@AndiKod 3 жыл бұрын
margin-bottom: 0px;
@CharleyCheno
@CharleyCheno 3 жыл бұрын
@@AndiKod pok
@kohelet910
@kohelet910 3 жыл бұрын
display : flex; flex-direction : column; justify-content : flex-end;
@abhaynath5833
@abhaynath5833 2 жыл бұрын
Grid and flexbox were lifesaver for me. I used to do layouts with float and clear properties. When I learnt grid and flexbox, one fine evening I created new git branch of the project, removed all 'float' and 'clear' from entire source code. As expected, layouts were broken. Then I implemented grid and flexbox. It was time consuming task but it was fun. It was 2 years back and I haven't wrote 'float' in any css file ever since.
@ove4k1llgaming14
@ove4k1llgaming14 4 ай бұрын
Idek what float is😂
@itsYovez
@itsYovez 2 жыл бұрын
I've always sourced to using Bootstrap or Tailwind for designing my websites. I've always been interested in back-end primarily so I never dabbled in front-end. But the goal is to be a full-stack developer soon, so I'll be switching over to raw CSS. Thanks for the tips!
@MarcinKralka
@MarcinKralka 2 жыл бұрын
I think the best unsaid tip is to focus and master the basics before going further and use frameworks, it's probably true for most stuff in software development.
@Mwtorres89
@Mwtorres89 Жыл бұрын
raw is always better ;)
@phunguyen858
@phunguyen858 Жыл бұрын
@@Mwtorres89 Tell Gordon Ramsey about it
@elle.3792
@elle.3792 Жыл бұрын
You can still use Bootstrap while using CSS. I frequently use css in my bootstrap code so that it does exactly what I want it to do, as opposed to the default bootstrap behaviour.
@goku546686
@goku546686 6 ай бұрын
Although raw is better most companies find it a time waster and will set you up woth tailwind or other frameworks. Buisness is about efficiency after all. I also say this because many a cocktail devs. Will claim css is easy and yet have come here to learn the 30 extra things they never heard about on css. What I'm saying Is css has ALOT and can become overwhelming. The basics aren't bad and mostly gone over in the video. Padding, margin, border and flex box along with grid are important.
@mandjcraft
@mandjcraft 3 жыл бұрын
From now on, I will use emoji class names on all my personal projects :D
@calimio6
@calimio6 3 жыл бұрын
Nightmare in debug street.
@precumming
@precumming 3 жыл бұрын
I use combinations of zero-width joiners and underscores for all of my class names.
@JeyPeyy
@JeyPeyy 3 жыл бұрын
We need keyboards with emojis
@precumming
@precumming 3 жыл бұрын
@@JeyPeyy You can get VS Code extensions which allow you to type ":muscle:" and get the flex emoji
@JeyPeyy
@JeyPeyy 3 жыл бұрын
@@precumming I'm sure my coworkers will love that such an extension is required to work with my code 🙃
@raghav.bhardwaj
@raghav.bhardwaj 3 жыл бұрын
CSS pro tip: You should use css variable to create day/night theme, instead of writing different code for different theme.
@skynet1024
@skynet1024 3 жыл бұрын
@@tomasvn09 thank you kind stranger
@classicguy7813
@classicguy7813 2 жыл бұрын
@@skynet1024 LOL kind stranger
@nicetomeetugaming7024
@nicetomeetugaming7024 2 жыл бұрын
Thanks!
@edwardelrics2138
@edwardelrics2138 2 жыл бұрын
LOL =))))
@valence707
@valence707 2 жыл бұрын
This was absolutely amazing. I've been learning simple web development for a couple of months now, and I've had so many issues with CSS, of which this video solved them all. Thank you!
@mubafaw
@mubafaw 2 жыл бұрын
One of the single most useful videos out there. Great explanation of the box model and editing directly on Firefox. The clamp() function blew my mind!
@detskysade2581
@detskysade2581 3 жыл бұрын
CSS was so confusing that I learned back-end tools instead. This video came out too late 😂
@aavocadoToast
@aavocadoToast 3 жыл бұрын
ayy backend gang all the way
@estoyboy
@estoyboy 2 жыл бұрын
I always find back-end devs saying CSS is hard so baffling when back-end seems like the real big brain stuff
@mattshnoop
@mattshnoop 3 жыл бұрын
I think over all my favourite CSS protip is; although, maybe less of a CSS tip and more of an organizational tip in general; how important it is to keep your DOM clean. When I first started, I would put divs everywhere with tons of nesting. When in reality, you can usually get away with having one div to one box on your page. Very little wrappers are needed if you take a second to think about what each element in your HTML is doing
@SK-009
@SK-009 2 жыл бұрын
Can you guide me to a video tutorial on this?
@An-li6er
@An-li6er 2 жыл бұрын
Yeah I also need a video for this, sounds interesting 🤔
@konstantinpaul8301
@konstantinpaul8301 2 жыл бұрын
@Anja and @SK: Have a look at the LayoutLand channel made by Jen Simmons. A good example, where she thinks about HTML first and then about styling is: kzbin.info/www/bejne/Y5nQgI2LbL-eZ5I
@k_viir7466
@k_viir7466 2 жыл бұрын
DOM sounds like a character of 2f2f for me, pitiful.
@hanchi3398
@hanchi3398 Жыл бұрын
Trueee
@geordanhouse8247
@geordanhouse8247 Жыл бұрын
Man, you by far have the best videos on KZbin for programming, Simple and to the point but also just down right funny as hell. Cheers man
@ashishsharma9126
@ashishsharma9126 2 жыл бұрын
I love this video particularly the use of GRID and animate elements using order var in-line style. Clamp() is super-cool. Thanks🙏
@fahada.979
@fahada.979 3 жыл бұрын
Been a frontend developer for last three years, this video made my life 100 times easier which i didnt know i needed, appreciate it bro!!!!
@gabrielchristiannegre2715
@gabrielchristiannegre2715 3 жыл бұрын
"The problem with this is that media queries will make you want to off yourself" that got me lmao
@addanametocontinue
@addanametocontinue 3 жыл бұрын
The first time I was introduced to media queries, I was like, "Wow, this is incredibly cumbersome. WTF? Who the hell would want to write 3 versions of the same layout?"
@Diegps
@Diegps 3 жыл бұрын
@@addanametocontinue I'm just beginning and I'm excited about media queries, your comment spoiled me
@tarangpatil6952
@tarangpatil6952 2 жыл бұрын
@@addanametocontinue your profile picture background colour is same as mine 😀😃
@GamingTSH
@GamingTSH 2 жыл бұрын
❤️👉 kzbin.info/www/bejne/op6sqIyCe76Nb7c 👈❤️..
@yuriprime4841
@yuriprime4841 Жыл бұрын
Another nifty thing to do - in my opinion at least - is to set te font-size of everything to 62.5% (by use of the HTML selector). This way you'll have a much easier time calculating sizes with the rem-suffix. In a nutshell, setting font-size to 62.5% causes 1 rem to be equal to 10 px
@MauriceCalis
@MauriceCalis Жыл бұрын
Wow, your videos are outstanding (judging by the 2 I've seem). This one provides so many useful upgrades to my CSS, and just the right time for me to "hear it". "When the student is ready, the teacher will appear". Thanks. Btw, I rarely subscribe to channels, but your presentation is just the way I like it. Reminds me of my favorite cuber channel (jperm).
@siddharth-gandhi
@siddharth-gandhi 3 жыл бұрын
Ahh the irony in "CSS is awesome" at 0:13 😂
@ludologian
@ludologian 3 жыл бұрын
Omega|lul
@shashikanthp3145
@shashikanthp3145 3 жыл бұрын
Nice catch 👌😂😂😂
@nickolasjoe
@nickolasjoe 3 жыл бұрын
Of course! That’s what’s naturally happens cuz overflow is visible by default 😂
@j-vahalla-b5051
@j-vahalla-b5051 3 жыл бұрын
just overflow:hidden 😂
@gladiator7249
@gladiator7249 2 жыл бұрын
lol it was funny tbh
@skyracer-mk8hg
@skyracer-mk8hg 3 жыл бұрын
5:10 I now am not in charge of CSS anymore. This saved my life and I thank you sincerely
@jonathan-arias
@jonathan-arias 3 жыл бұрын
It totally blow my mind.
@blakel95
@blakel95 2 жыл бұрын
Great Video. For anyone who develops on Chrome: The features from Firefox @ 2:00 are also available on Chrome. Under Computed, any value under box model is editable if you double click. Chrome has grid lines on screen available under Layout, but I suppose Firefox has nicer graphics for that. Just wanted to note.
@RahulJain-ck5bt
@RahulJain-ck5bt 2 жыл бұрын
Loved it 💯. I am working with CSS for about 2 years but didn't know about clamp and focus-within. You saved my life ❤️
@MichaelRichins
@MichaelRichins 3 жыл бұрын
One of the largest struggles I had while learning CSS was precedence. Too many times have I come across "! important" on properties that shouldn't have needed them! Great video!
@Fireship
@Fireship 3 жыл бұрын
If you see !important everywhere... !run
@rafadydkiemmacha7543
@rafadydkiemmacha7543 3 жыл бұрын
2:42 Correction: position absolute 50% doesn't move the element to the far right and/or bottom. It moves the left and top corner of the element to the center of the parent. Then we apply translate to move it back by its own half, having the element perfectly centered in the parent.
@Sedeerah
@Sedeerah Жыл бұрын
Thanks! I am new to all this and was wondering how that part made any sense. Now it (kinda) does.
@dirtymint
@dirtymint 2 жыл бұрын
Your videos are steadily bringing back the passion I used to have for web development. Thank you.
@MinecraftEpicGames
@MinecraftEpicGames Жыл бұрын
i dont really have a problem with using the css, but more with making things look good. there is always something that makes me mad because it doesnt look like how i want it to look like
@adryeeel
@adryeeel Жыл бұрын
Same
@iA4R0N
@iA4R0N 3 жыл бұрын
I feel like I'm pretty good with CSS, and then I watch this video and feel like you just opened up a new world for me. This is great, I love these kinds of videos!
@chawker67
@chawker67 3 жыл бұрын
The protip: you can build awesome responsive layout with (almost) one line of CSS. Use { display: grid grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)) } and see how elements in your grid shrink and grow depending on the parent grid size. You can also add *grid-gap* to make it even better. It's great for something like i.e placing video thumbnails like KZbin does.
@codelightsparkles2403
@codelightsparkles2403 3 жыл бұрын
Indeed, the autofit property is pretty cool. Try out flex-wrap: wrap. It does almost the same thing 😀
@rodrigolustosa9090
@rodrigolustosa9090 2 жыл бұрын
In case we have a display:flex , what do we could do instead?
@peteregbujie
@peteregbujie 2 жыл бұрын
@@rodrigolustosa9090 grid is ideal for multiple column/row layout while flex is ideal for single column/row. I suggest you change it to grid
@GamingTSH
@GamingTSH 2 жыл бұрын
❤️👉 kzbin.info/www/bejne/op6sqIyCe76Nb7c 👈❤️......
@shoumikkumbhakar338
@shoumikkumbhakar338 2 жыл бұрын
@@rodrigolustosa9090 flexWrap : 'wrap'
@SimpleDesign1990
@SimpleDesign1990 Жыл бұрын
Great tips, and love the way you incorporate humor - makes the videos entertaining and more digestible. Thank you!
@stoufa
@stoufa 2 жыл бұрын
Awesome video, thanks for sharing these great tips, looking forward to watching the next CSS videos
@hexafireworks
@hexafireworks 3 жыл бұрын
The quality is top notch! Legit blew my mind on how effective it’s explained. Thanks and well done :)
@MegaJohnThunder
@MegaJohnThunder 3 жыл бұрын
This is amazing. I use all these techniques and they all took hours to days to learn and memorize, and here it is in one handy video. Good work!
@user-ty5pd4xw2y
@user-ty5pd4xw2y 2 жыл бұрын
The most simple video on positioning I 've seen ! Many thanks! Subscribed=))
@monikapatel6464
@monikapatel6464 2 жыл бұрын
Thank you for your video. Clamp(), counter for header number and passing css variable in style to order was totally new to me.
@dev.hardik
@dev.hardik 3 жыл бұрын
Web Dev:- CSS is fuck the mind 😵 Fireship:- Hold my beer 🍻 Thank you for the fire 🔥 content 💖
@jathur_
@jathur_ 3 жыл бұрын
69 likes dude
@dev.hardik
@dev.hardik 3 жыл бұрын
@@jathur_ yeh bruh 🤗
@sleepteam
@sleepteam 3 жыл бұрын
The counter will be huge for me! I have a lot of dynamic lists in a current project. Awesome tip.
@liss35
@liss35 2 жыл бұрын
I am currently learning programming and I find your video as informative. Thank you this is great 👏👏👏
@ianhancock3414
@ianhancock3414 2 жыл бұрын
Hey sir! thank you for this video I am have been struggling a little with css this was such a drop of knowledge! the clamp is a game changer!
@fiddle4759
@fiddle4759 3 жыл бұрын
I thought I was pretty good at CSS, and after watching this video it turns out that apparently I am. However, I still learn from every single video you post, including this one. Best channel on KZbin for web dev!
@thomasmelak
@thomasmelak 3 жыл бұрын
Awesome content as always, I learn something new from your videos all the time! The most exciting property I learned about in css recently is object-fit for images and video, if you'd like to set a specific width and height to the element you can use object fit to prevent any type of distortion or stretching.
@dfslkjhdsfgldfjh
@dfslkjhdsfgldfjh Жыл бұрын
I'm currently learning CSS/JS and omg.. This video taught me more than my last 10 hrs of studying. Thank you so much!!
@greateagle8799
@greateagle8799 3 ай бұрын
You sent me down so many rabbit holes, this 10 min video has led to 2+ hours of notes. Thank you for your teaching magic
@DanielCardoso5
@DanielCardoso5 3 жыл бұрын
Amazing content as always! The top: 50%; left: 50%; actually brings the element to the middle of the parent and then the transform just subtracts half of the width and the height of the actual element.
@NikhilYadav-ji8rm
@NikhilYadav-ji8rm 3 жыл бұрын
This has inspired me to write css like never before, few people can achieve this level of viewer retention and content quality. Kudos fireship, you've won our hearts
@otterpupp
@otterpupp 2 жыл бұрын
incredibly useful! I learned CSS in the early ays but needed to catch up on all the new stuff. Thank you!
@juanfranciscojesushernande3396
@juanfranciscojesushernande3396 Жыл бұрын
I love this witty high quality content. Thank you for sharing your knowledge.
@theramenboy
@theramenboy 3 жыл бұрын
Nice video as always! For the sake of learning how CSS works avoid framework or utility class is necessary but after you understand how it works using those tools is a lot of time saving for sure
@tanmay______
@tanmay______ 3 жыл бұрын
I just binged your channel today, then you dropped this video, it is a lucky day :)
@TallSchmuck
@TallSchmuck 2 жыл бұрын
I have been watching you for ages and youve been helping me become the developer I am today. Keep up the good content
@ABHAY-hu9kw
@ABHAY-hu9kw Жыл бұрын
I am about to start CSS , no prior knowledge in it. But, your way of explaining is very awesome as I WAS ABLE TO UNDERSTAND CSS WITHOUT MUCH DIFFICULTIES
@pankajaw
@pankajaw 3 жыл бұрын
I've never been this excited to work on CSS. This is great
@_RafaelKr
@_RafaelKr 3 жыл бұрын
These tips are so good! I learned some very cool new stuff 😎 But I noticed a little mistake in the animation at 2:44. The 50% top and left will place the poops top-left edge in the center of the box. The poop is NOT placed in the bottom-right edge of the box.
@tagon35
@tagon35 Жыл бұрын
I agree with a fundamental understanding of CSS. That being said, tailwindcss, postcss, and autoprefixer have made my jump into Angular very smooth given my limited and dated experience with HTML/CSS.
@liorgonnen
@liorgonnen Жыл бұрын
Mind blown from the amount of useful information condensed into such a small footprint🤯
@SimplyFizz
@SimplyFizz 3 жыл бұрын
I just clicked on your channel after watching the rpi server one, and you made this video minutes ago lolz
@Fireship
@Fireship 3 жыл бұрын
Welcome to the channel :)
@phongnguyentuan8219
@phongnguyentuan8219 3 жыл бұрын
Great content as always. The part where you explain centering with absolute, I believe top: 50% is 50% of the parent, same with the left. Therefore, the child is at the center of its parent. However, the child is centered by its top left corner so we need to transform the child -50% (which is now 50% of the child width/height) to correctly center it by its center.
@Muffi606
@Muffi606 Жыл бұрын
I haven't see any video that is so short, so simple and so amazing, THANKYOU VERY MUCH
@andriistrilchuk7339
@andriistrilchuk7339 3 ай бұрын
"focus-within" is something new! Thank you!
@Bobywoodwarrior
@Bobywoodwarrior 3 жыл бұрын
Thank you, that's awesome! What about a video on how we can keep a good font size ratio based on screen width ?
@user-yd7db3wd7w
@user-yd7db3wd7w 3 жыл бұрын
Clamp and fancy calculations blew my mind 🤯
@undefinedvariable8085
@undefinedvariable8085 2 жыл бұрын
Wait. . . Soon we'll have: 1. container queries 2. layers 3. scopes
@McWolke92
@McWolke92 2 жыл бұрын
:focus and :focus-within is such a great tip, i can't believe i've written js to manage states for popups and dropdowns all those years.
@mrcash1309
@mrcash1309 2 жыл бұрын
As always very good content. I wrote a lot of CSS druing the last months and most of the mentioned points aren't new or not completely new to me. But The focus-within thing for example is something being completely off my radar so far. This will change :) BUT: I do miss one tip here, which hasn't directly to do with how to write your CSS, and this is Normalizing! Make sure that all html elements look the same (as far as browser support goes of coz) when no custom style is applied. This would also apply the border-box model which is not the default one. And one additional thing: Collapsing margins! which is also quite unkown and even called a "bad" thing by the creators and maintainers of CSS itself. Still loving your videos
@rancho890
@rancho890 3 жыл бұрын
I knew all of this and still enjoyed it 💯
@omercak2746
@omercak2746 2 жыл бұрын
Best 10 mins I ever spent on KZbin. Thanks!
@adminfebhost
@adminfebhost 2 жыл бұрын
U just earned a sub bro. u saved 2 weeks of my frustration from going further. and now i feel like i can make any design thanks to you
@adityashrivastava6004
@adityashrivastava6004 3 жыл бұрын
Two defining moments of the 21st century- 1. The day I was born. 2. The day I learned the box-modal.
@biniteshome1403
@biniteshome1403 3 жыл бұрын
really man? I hate CSS if that helps I will jump on it right now. thanks.
@rickpereira8821
@rickpereira8821 2 жыл бұрын
Love these tips, thank you! Combining this with your following video (3 more life changing tips), I'm loving the possibilities of variables with HSL for dark theme support: :root { --H1: xx; --S1: xx; --L1: xx; --text-color: hsl(var(--H1), var(--S1), var(--L1)); } .light-theme { --L1: 25; } .dark-theme { --L1: 225; } I haven't tested this yet.
@family.vibes.unleashed
@family.vibes.unleashed 3 жыл бұрын
Wow! Learnt many unknowns about CSS in less than 10 minutes. Now I am going to watch the video again to note down all these learning. Thanks a lot! LIKED & SUBSCRIBED
@muhammadfazil1608
@muhammadfazil1608 2 жыл бұрын
Found u in my recommendation and the way you explain each nd everything just love it. 😍❤️
@_cmcg
@_cmcg 3 жыл бұрын
Pro Tips: 1. Stack box-shadows with varying parameters and opacity to get a more detailed and polished look. 2. Create a master file that you can use between projects to give you simple classes like "img-border-radius", "btn-border-radius". "primary-color", "primary-light", "error-color" - these keep stylesheet calls from CSS frameworks from bloating your site. 2A. Use SASS/SCSS and create variables to use inside the classes, so you only have to change 20 lines of code instead of 500, but you still get a custom look per site
@HartleySan
@HartleySan Жыл бұрын
Great video. I still prefer Sass though, merely for nested CSS and (in my opinion) easier variable definitions.
@adrianpilea5108
@adrianpilea5108 3 жыл бұрын
Great video! It opened my eyes for a lot of stuff i wasn't very sure about! Thanks
@deepeshkumarmishra2643
@deepeshkumarmishra2643 3 жыл бұрын
This is one of the easiest CSS tutorial across tutorial. I've known the properties but I couldn't use em correctly. This made things way more understanding.
@fairytailnaruto7693
@fairytailnaruto7693 3 жыл бұрын
Thanks god, this video finally arrived. CSS is such a pain but I try to be better everyday !
@thebtm
@thebtm 3 жыл бұрын
I remember the days of old CSS... Love the CSS3 and how easy it is.
@blkemerone4099
@blkemerone4099 Жыл бұрын
l love ccs too but i lm new at dev
@fherdylianza7532
@fherdylianza7532 2 жыл бұрын
Every single minutes on this video is great! You got another subs bro
@mariomachado797
@mariomachado797 3 ай бұрын
Your jokes were so funny this time that I missed some of you coding points right after and had to rewind to watch multiple times xD love it
@anzeblagus9513
@anzeblagus9513 3 жыл бұрын
The amount of time this could've saved me in the past and will save me in the future is immeasurable
@emeraldpeterolu7289
@emeraldpeterolu7289 3 жыл бұрын
Hi, i am an instructor and would love to know the processes you follow to make your videos ? They are so concise and still very informative, and the way you go about explaining is so coooool. Thanks by the way.
@raysaflaye
@raysaflaye 2 жыл бұрын
Very nice explained, you're a better teacher than most from schools!
@surajitdas6555
@surajitdas6555 3 ай бұрын
I knew all the concepts and used everything till date, but happy to see all these information together ❤
@priestap
@priestap Жыл бұрын
Thank you for this. I've been writing CSS since 1999 and didn't know some of these things.
@NielsNL1
@NielsNL1 Жыл бұрын
24 years?
@reecebygrave7211
@reecebygrave7211 Жыл бұрын
@@NielsNL1 1999 is 24 years, yes you are correct
@ecs1611
@ecs1611 3 жыл бұрын
This is one of the most helpful videos I've ever watched... Maybe CSS isn't too bad.
@warrenphakathi6228
@warrenphakathi6228 2 жыл бұрын
This was really helpful...hope you create more
@piccolaradge8333
@piccolaradge8333 Жыл бұрын
This is sooo helpful!! Thank you! 🙏🏾
@Shubham-xh9nz
@Shubham-xh9nz 3 жыл бұрын
I just love how much knowledge this guy puts in 10min video.
@bhushanjoshi8675
@bhushanjoshi8675 3 жыл бұрын
You are on fire 🔥 man❣️
@martinsroyale8400
@martinsroyale8400 9 ай бұрын
You explained life-saving tips in less than 10 minutes. Thank you. ❤
@codewithfelix3940
@codewithfelix3940 5 ай бұрын
this is my first video seeing you code, you are good.🙏
@MohilNZ
@MohilNZ 3 жыл бұрын
You can edit box model properties in Chrome too in newer versions. For 02:11
@IllicitPrism
@IllicitPrism 3 жыл бұрын
I NEED THIS!
@mariaali427
@mariaali427 Ай бұрын
I have never been happier to watch a video. This is so informative
@darrenforster99
@darrenforster99 2 жыл бұрын
One of the best things I found to do with CSS is to use an idea found in Bootstrap - create small styles as building blocks and apply those small styles to the different elements - like for example I created a few styles called fs-x_x going from fs-0_5 incrimenting by 0_1 up to 3_0 - in each of those styles I had one line of CSS font-size : and then the number followed by em so fs-0_5 would be font-size:0.5em; fs-3_0 would be font-size 3.0em - that way if I wanted to make the font size bigger or smaller I could just add the class fs-x_x to the element. I based this idea on some of the things that bootstrap does like the my- or px- classes which change the padding/margin by a set amount. I also did the same with colour c- and bg- That way if I wanted a bit of text "brand red" with "brand yellow" background, a bit smaller than the other text with no X padding and a large Y margin I could always do
100+ Web Development Things you Should Know
13:18
Fireship
Рет қаралды 1,3 МЛН
Learn CSS BOX MODEL - With Real World Examples
17:45
Slaying The Dragon
Рет қаралды 68 М.
Угадайте концовку😂
00:11
Poopigirl
Рет қаралды 4 МЛН
In 10 Minutes This Room Will Explode!
10:00
MrBeast
Рет қаралды 44 МЛН
Парковка Пошла Не По Плану 😨
00:12
Глеб Рандалайнен
Рет қаралды 12 МЛН
I built the same app 10 times // Which JS Framework is best?
21:58
Fireship
Рет қаралды 2,4 МЛН
CSS Tips And Tricks I Wish I Knew Before
12:12
Lama Dev
Рет қаралды 379 М.
How programmers flex on each other
6:20
Fireship
Рет қаралды 2 МЛН
Learn Flexbox CSS in 8 minutes
8:16
Slaying The Dragon
Рет қаралды 1,3 МЛН
Top 10 CSS One Liners That Will Blow Your Mind
13:34
developedbyed
Рет қаралды 863 М.
How to Learn to Code - 8 Hard Truths
6:46
Fireship
Рет қаралды 2,1 МЛН
7 ways to deal with CSS
6:23
Fireship
Рет қаралды 1 МЛН
Learn CSS Positioning Quickly With A Real World Example
8:32
Slaying The Dragon
Рет қаралды 536 М.
God-Tier Developer Roadmap
16:42
Fireship
Рет қаралды 6 МЛН
Broken Flex Repair #technology #mobilerepair
0:55
ideal institute aligarh
Рет қаралды 15 МЛН
Iphone yoki samsung
0:13
rishton_vines😇
Рет қаралды 9 МЛН
Phone charger explosion
0:43
_vector_
Рет қаралды 5 МЛН
Секретная функция ютуба 😱🐍 #shorts
0:14
Владислав Шудейко
Рет қаралды 1,7 МЛН
СЛОМАЛСЯ ПК ЗА 2000$🤬
0:59
Корнеич
Рет қаралды 1,2 МЛН