The 6 most important CSS concepts for beginners

Sdílet
Vložit
  • čas přidán 17. 06. 2024
  • When we first get started with CSS, we hear a lot of new terms and jargon, a lot of which is glossed over pretty quickly. In this video, I look at the most important things to know when getting started, but I also look at why they matter, and how to work with them or take advantage of them to write better CSS.
    🔗 Links
    ✅ More info on the box model and box-sizing: • box-sizing: border-box...
    ✅ More info on specificity: • CSS Specificity explained
    ✅ Getting started with flexbox: • Learn flexbox the easy...
    ✅ Getting started with grid: • Learn CSS Grid the eas...
    ⌚ Timestamps
    00:00 - Introduction
    01:37 - Inheritance
    07:48 - The Cascade
    12:09 - Dealing with the box model
    15:04 - Specificity
    18:46 - Naming stuff is hard
    20:58 - Creating layouts
    25:22 - Content vs Layout
    #css
    --
    Come hang out with other dev's in my Discord Community
    💬 / discord
    Keep up to date with everything I'm up to
    ✉ www.kevinpowell.co/newsletter
    Come hang out with me live every Monday on Twitch!
    📺 / kevinpowellcss
    ---
    Help support my channel
    👨‍🎓 Get a course: www.kevinpowell.co/courses
    👕 Buy a shirt: teespring.com/stores/making-t...
    💖 Support me on Patreon: / kevinpowell
    ---
    My editor: VS Code - code.visualstudio.com/
    ---
    I'm on some other places on the internet too!
    If you'd like a behind the scenes and previews of what's coming up on my CZcams channel, make sure to follow me on Instagram and Twitter.
    Twitter: / kevinjpowell
    Codepen: codepen.io/kevinpowell/
    Github: github.com/kevin-powell
    ---
    And whatever you do, don't forget to keep on making your corner of the internet just a little bit more awesome!

Komentáře • 177

  • @Maxelya
    @Maxelya Před 2 lety +209

    Not exactly related, but it's been months since I wanted to write this :
    As a (now employed) self-taught developer I used to really struggle with CSS and I was pretty sure I would have to find a job as a back-end dev since I couldn't do anything without bootstrap. But then, I stumbled across a company looking for a "true" full-stack dev. That's when I decided that it was time to do something about my css weakness. I started watching tons of vids on the subject and quickly found your channel and got the job.
    Less than a year later, I'm now working as a full-stack developer and a teacher, I now wish I could get rid of bootstrap (which my company still uses) and I'm obsessed with writing clean code (grid blew my mind and forever changed the way I write HTML).
    I still have tons of things to learn, but the best thing your channel did to me was actually make me LIKE css. And when I like something, I can't get enough of it ^^.

    • @RickBeacham
      @RickBeacham Před 2 lety +1

      Congrats! What STACK do you like the most?

    • @diwakardayal954
      @diwakardayal954 Před 2 lety

      thanks for the inspiration, May I ask what u did to perfect your JS? what helped you most in JS

    • @Maxelya
      @Maxelya Před 2 lety +4

      @@RickBeacham Thanks ! That's the cool part : I no longer have any preference ^^ meaning I get to fully enjoy my job. CSS was the only thing I used to really hate though because it was not "programming" and I didn't fully understand how it worked, leading to a lot of frustration -_-

    • @Maxelya
      @Maxelya Před 2 lety +3

      ​@@diwakardayal954 With JS and programming in general I was lucky enough to grasp the logic rather quickly by solving algorithms.
      Then you can learn DOM manipulation/Event Listeners which might be confusing at first but really, you don't need to know a lot of it to start doing cool little apps with it.
      Especially with DOM manipulation I like to organize my code in a really simple way in order for make it look easy.
      Watching others coding on youtube also helps a lot to learn how to write clean code. Be curious !

    • @sprtlife6261
      @sprtlife6261 Před 2 lety

      amazing!

  • @zachjensz
    @zachjensz Před 2 lety +122

    Already know all of this but watched anyway because it's Kevin!

    • @sagaryerguntala909
      @sagaryerguntala909 Před 2 lety +1

      True fan 😃😂

    • @danisob3633
      @danisob3633 Před 2 lety

      its kevin :D

    • @acubley
      @acubley Před 2 lety +1

      I knew it, but I didn't really know it. 😐

    • @Miretazam
      @Miretazam Před 2 lety +1

      Why is his comment from 2 days ago? The video has been uploaded from 12 hours ago

    • @acubley
      @acubley Před 2 lety

      @@Miretazam He's a time traveler and it's the only way to watch all of the YT he wants to?

  • @theatypicaldeveloper
    @theatypicaldeveloper Před 2 lety +8

    this vid pretty much covers every subject that you need to know when starting out with CSS, great stuff.

  • @iambabyr0o
    @iambabyr0o Před rokem +1

    This is an amazing video! Thank you, Kevin! Appreciate you sharing stories about your own mistakes - it really helps build confidence and not focus on own clumsiness.

  • @sep1ol
    @sep1ol Před 2 lety

    hey Kevin, i've started diving deeper into CSS past week and eventually i found your channel.
    just wanted to say thanks, such great content, it's been really VERY helpful.
    have a great day :)

  • @JG-ky6pw
    @JG-ky6pw Před rokem +1

    You are the best. I went to a Bootcamp and I struggle a lot with CSS. Thanks to you I understand what is going on. Thank you so much Kevin!

  • @iChrisBirch
    @iChrisBirch Před 4 měsíci

    The tip about separating layout and design selectors is gold. I've fought this so much when trying to re-use patterns and trying to override so many properties. Huge thanks for this video.

  • @jovani4921
    @jovani4921 Před 8 měsíci +1

    You freestyling that dark-background color number @ 20:10 is goals 👏👏

  • @kapteinkonyn3450
    @kapteinkonyn3450 Před 2 lety

    Thanks for this! Your channel is really helping me with CSS topics that I used to struggle with.

  • @simboy
    @simboy Před rokem +1

    as a self taught web dev everything ive learnt has been on-line and this is one of the best and clearest yet not dummed down videos out there which is a huge rarity ..if your like me and have spent hours watching videos where they are explaning stuff and they somehow manage to skip the bits that are subtle a not obvious and after ten vidoes your like - yeah, they may be good programmers but not very good teachers - and then compared to all that, this is great

  • @jaymarley6172
    @jaymarley6172 Před 2 lety

    I am a frontend developer checked out your earlier course html and css from 2016 and you also covered very well back then some of these concepts good to see it being transferred here as-well ... has also really helped me at work ... thank you for all your good content and continued efforts really appreciated.

  • @Wandering_Horse
    @Wandering_Horse Před 2 lety

    Wow, thank you. Your videos are so clearly articulated and I really enjoy the video layout and production. As someone new to html and css your videos are so far more helpful then anything else I have worked with so far. In this video you explanations of inheritance, cascading, and specificity where my biggest take aways. I have been working on a simple web form and was given example css styling to go with it and I found myself going back and forth where modifying one thing would not make a change and then I found myself trying to hack it by force before finally just commenting out all the css and reintroducing one element at a time. Had I known about inheritance, cascading and specificity all of that could have been avoided. The great thing is I now have my go to source for all my html and css knowledge. Thank You!

  • @alouisjeanmedia7723
    @alouisjeanmedia7723 Před 2 lety +17

    Everything in this video touched on exactly where I'm at in my coding journey. Felt like you were doing a class specifically for me. Thanks, Kev!

    • @mcfliermeyer
      @mcfliermeyer Před 2 lety +2

      Same! His teaching style is sooooo good for me

  • @andresmillsgallego814
    @andresmillsgallego814 Před 2 lety

    Wow, amazing video . I can tell you put a ton of work into your videos which I respect and appreciate! Just found your channel, look forward to checking more of your videos out.

  • @zachj7078
    @zachj7078 Před 2 lety

    I knew all these very vaguely but this has really enlightened me, thank you! 😊

  • @CulturalToast
    @CulturalToast Před 2 lety +4

    Love your channel! You have helped me so much!

  • @duvanxo3033
    @duvanxo3033 Před 2 lety

    every time I look for css videos your channel pops up! love your videos :)

  • @aravis_
    @aravis_ Před rokem

    Thanks for your videos, I am actually starting to enjoy coding way too much (as I originally thought I would) because you explain things in a way I actually understand and don't make me feel dumb lol. Thanks so much, you have no idea how excited I am now on my journey. Thanks so much for all your videos!

  • @sanfords
    @sanfords Před rokem

    I was doing a grid layout and having some bizzare issues with content going outside of the grid - then I added your box-sizing hack and whalla - mystery gone! Wow what a GREAT TIP!

  • @Xevailo
    @Xevailo Před 2 lety +3

    Hey Kevin,
    I just wanted to leave a HUGE thank you for making this channel! I am currently in the process of learning CSS and your videos are an incredible help there! Your style of teaching the subjects is on point, pragmatic and paced just the right way that I feel as if I'm understanding things. And though I still have a long journey ahead of me, I am beginning to feel confident that I may some day build something that actually looks nice, too!
    If I may leave one bit of constructive criticism though:
    In your video about "6 simple typography tips to more professional looking sites" you mostly work in Figma to draft the layout, which is absolutely understandable as a way to quickly visualize the effect certain changes will have. One thing I (as a complete novice) would have wished though would be that you briefly would have said how a CSS-porperty to achieve that COULD look like. Sometimes you did that but other times not, and it would have been a good crutch for me as well as repetition for more advanced viewers.
    I hope you have a great start into 2021 and am looking forward to learn more from you :)

  • @alibaba0428
    @alibaba0428 Před 2 lety

    dude, where have you been my whole life? this video is amazing and has made my life a little bit easier.

  • @user-mb3fg2he3m
    @user-mb3fg2he3m Před 6 měsíci

    Props for the hint on separating layouts from the design selectors 👍
    Valuable recording there.

  • @Adjust91
    @Adjust91 Před 2 lety +1

    Fantastic. Your content is extremely helpful as im focusing on css to land my junior job!

  • @qxb348
    @qxb348 Před 2 lety +3

    this is really helpful! thank you!❤

  • @CharlesSmall
    @CharlesSmall Před 2 lety

    Thank you for keep us up to date.

  • @dennyw17
    @dennyw17 Před rokem

    Awesome video! Just what I needed. Thanks!

  • @hectorg362
    @hectorg362 Před 2 lety

    Content vs Layout. That's something I never really put much thought of until now. Thanks! WIll keep that in mind for now on.

  • @mwengemwanambale8659
    @mwengemwanambale8659 Před 11 měsíci

    Hi Kevin , thank you for your videos CSS has become more easier to deal with since i started watching your videos

  • @bobbysilver272
    @bobbysilver272 Před 2 lety

    The specificity in this video was very specific. Thank you :-)

  • @80Vikram
    @80Vikram Před 2 lety

    As always thank a ton for your knowledge sharing, god bless you. Happy + prosperous new year 2022

  • @LazarusStr
    @LazarusStr Před rokem

    Thank you for creating this video. I've watched it three times because I loved your explanation and breakdown. I appreciate the effort you made to create this content. 🌺☺

  • @abdihakimguliye8207
    @abdihakimguliye8207 Před 2 lety

    The CSS KING IS back! Kevin thanks for the concepts. Please do also JS most important concepts.

  • @md.arafathrahmankhan6076

    Really an aswesome video for those who're gonna start their journey with CSS. Keep it going kevin, make more beginner friendly videos. Thanks.

  • @bySterling
    @bySterling Před 2 lety +1

    Ahhhh man I would LUV if you had secondary alternate shorts versions of your amazing vids for those of us usually ‘short’ on time (just don’t have a half hour for each vid to spare)

  • @kadagalaganesh4230
    @kadagalaganesh4230 Před 2 měsíci

    Not gonna say more, this video simply amazing for CSS learners.

  • @AzimXma
    @AzimXma Před 2 lety +2

    Great explanation buddy❤️
    Keep it up 👍

  • @WebDevYTLearningAccount
    @WebDevYTLearningAccount Před 6 měsíci

    I'm currently taking Colt Steele's web boot camp and I'm glad everything you reviewed I have an idea on due to his course, so this was a good watch for multiple reasons.

  • @ferrystech6066
    @ferrystech6066 Před 2 lety

    Great video! i have done allot of CSS in my professional career and i definitely can find myself in this video.

  • @MrKay23
    @MrKay23 Před 2 lety +1

    Wow this video was super super helpful!

  • @Kai-zein
    @Kai-zein Před 2 lety

    Thank you Sir for all tutorial and advice! WE LOVE YOU

  • @Pareshbpatel
    @Pareshbpatel Před 2 lety +1

    A really good tutorial on the most important CSS concepts. Separating concerns regarding Layout and Styling is something I found very illuminating. Also, I was having a hard time choosing between FlexBox and Grid to start with. Grid it is. Thank you, Kevin
    {2022-01-08}

  • @henrysmith6578
    @henrysmith6578 Před 2 lety +1

    Thank you for such an informative video! Your channel is amazing. I'm so happy someone recommended I check it out!

  • @Jordan-nv8dt
    @Jordan-nv8dt Před 2 lety

    This is the best video!
    Thank you for teaching me so much

  • @hjetwd
    @hjetwd Před 2 lety +3

    Kevin, as always, pumps our brains. 🤗

  • @mandyb-vs4cc
    @mandyb-vs4cc Před rokem

    This is a great content. Thank you very much for this.

  • @azuraflame1
    @azuraflame1 Před 11 měsíci

    You really are a great dude for these videos Kevin and you are really great teacher.

  • @Sampad-Sarker
    @Sampad-Sarker Před 2 lety

    thanks for life saving lessons,I really mean it

  • @alialrahem9817
    @alialrahem9817 Před 11 měsíci

    Thank you for your tips and recommendations really helpful

  • @reoxb
    @reoxb Před rokem

    Thanks so much, this was so helpful to me.

  • @bswck
    @bswck Před 7 měsíci

    A fantastic video! Thanks 👍

  • @Smalls-iT
    @Smalls-iT Před 2 lety

    I feel motivated to break out the text editor again. Thanks for the vid 👍.

  • @Fullsunfl00wer
    @Fullsunfl00wer Před rokem

    Thank you for sharing!

  • @durgfestivalvibes
    @durgfestivalvibes Před rokem

    Great video, thanks!!

  • @iliyansvechev8113
    @iliyansvechev8113 Před 2 lety +1

    the best channel ever thank you kevin

  • @LiHou
    @LiHou Před 10 měsíci

    Nice content! Really enjoyed

  • @b1mind
    @b1mind Před 2 lety +2

    Words are hard 😂Kevin- "After 5 years of making videos, I can finally say specificity"

  • @michaelgleason4791
    @michaelgleason4791 Před rokem

    I felt that intro in my soul.

  • @Powerful-Manifestor-
    @Powerful-Manifestor- Před 2 lety

    So well said when you say "most of the things we read about in the beginning but then forget" and then run into trouble later 🤣🤣 So true!

  • @code-tox6203
    @code-tox6203 Před 2 lety

    Kevin The Css guru.
    your every videos teach me something new ♥️

  • @ziranshuzhang6831
    @ziranshuzhang6831 Před 2 lety +3

    CSS is always, always, the part that takes me most of the time whenever there is web development.

  • @zoirradjabov1420
    @zoirradjabov1420 Před 2 lety

    I've got much useful stuff from this video, tnx✌

  • @dannygarcia8353
    @dannygarcia8353 Před 2 lety

    Thank you Kev!!

  • @eccenux
    @eccenux Před 2 lety

    Great video. Even though I kind of know all this it is still good to organise your knowledge.
    One thing I would add is that in general inheritance work for font things and it doesn't work for layout things.

  • @durppp
    @durppp Před 2 lety

    The CSS king. Keep on kingin’ king 👑

  • @MikeKoss
    @MikeKoss Před 2 lety +10

    When you refer to "the Cascade" in this video, I get the impression you're just talking about the order of style declarations in a style sheet. But, in my reading of the spec, it uses that term to apply to ALL the factors that affect when a style is chosen over competing styles. Out of 5 different factors to consider, the position of the declaration is the least important (#5).

  • @JohnBortins
    @JohnBortins Před 2 lety +1

    Outstanding!

  • @hassaneoutouaya
    @hassaneoutouaya Před rokem

    Thank you so much !

  • @thecatmanager
    @thecatmanager Před 2 lety +1

    Very helpful

  • @ahmadfaisal6356
    @ahmadfaisal6356 Před 2 lety

    big thanks for this video

  • @Bookseeke
    @Bookseeke Před 2 lety

    Oh my God it worked 😅 thank you!!

  • @ikechukwualita521
    @ikechukwualita521 Před 2 lety

    Thanks Kevin. ... U're just superlative!

  • @legostud
    @legostud Před 2 lety

    I hadn’t seen the prettierrc file, but the guys here setup an eslint and style lint files. Stylelint is pretty cool, because we have it setup to to control the order of properties. We also have something that does accessibility checking in JSX files.

  • @ludwigvillalba1886
    @ludwigvillalba1886 Před 2 lety +1

    Thanks!!!!

  • @DaPaBe1999
    @DaPaBe1999 Před 2 lety

    Kevin I suggest doing a video about CSS methods|functions that are very useful, it is very important for responsivness

  • @cold_
    @cold_ Před rokem

    the last tip is amazing

  • @bryanthompson1070
    @bryanthompson1070 Před 2 lety

    Kevin, great videos. What video recording software do you use?

  • @RickBeacham
    @RickBeacham Před 2 lety +2

    Thanks Kevin! Great concepts to never forget. Did you know your one of the most famous Canadian devs on youtube after Ryan Reynolds?
    This is what I'm dealing with at work...
    .main-container .main .col-main .thread-products ul.thread-grid li.item span {
    padding-left: 70px;
    }
    .page .main-container .main .col-main .thread-products #products-list.thread-grid li.item span .price-box {
    margin: 5px 5px 5px 0 !important;
    }
    This could have been named :
    .threads-price-box {
    margin: 5px 5px 5px 0
    }
    😅

    • @RickBeacham
      @RickBeacham Před 2 lety +1

      I suppose they did not want to edit the theme files from Magento too much...

  • @80Vikram
    @80Vikram Před 2 lety +2

    Can you please make a video on how to style a page, after receiving design from designer. Let's take a complex FB profile page or newsfeed page. This will be really helpful. As a beginner I struggled a lot about CSS where to start styling and how to proceed. Learnt through trial and error, thanks in advance

  • @viniciusm.m.7822
    @viniciusm.m.7822 Před 2 lety

    THANKS!!!

  • @drankenstein5241
    @drankenstein5241 Před rokem

    I'm learning html n css and feeling like I will never get it. This really made things click for me. Thank you sir

  • @michaelengelby732
    @michaelengelby732 Před 2 lety +1

    Interesting. Specificity is like Order of Operations for the math folks out there. Never made that connection before. I am going to try and write up the rules of specificity so that it follows an order of operations ruleset. Might be an exercise in folly, as there as so many exceptions, but in doing so I will learn more things about it.

    • @chomo54andbabyaisha97
      @chomo54andbabyaisha97 Před 2 lety

      Really, how hard can it be to say speficiticity

    • @chomo54andbabyaisha97
      @chomo54andbabyaisha97 Před 2 lety

      Specificity is an absolutely horrible word, much easier to say is precedense.
      There is a precedense rule in Javascript too, and Mozilla has a splendid article on it.
      A lot of it is built on the presedence in boolean logic and math which both have individual precedense rules. Most know that addition has lower precedense than multiplication in math (so multiplication will be executed before addition), but the same is true in boolean logic, where OR has a lower precedense than AND in the order of which it will be executed (so AND will be executed before OR).
      *javascript operator precedence mdn*

    • @chomo54andbabyaisha97
      @chomo54andbabyaisha97 Před 2 lety

      You can also use an *online CSS specificity calculator*

  • @skynettava
    @skynettava Před rokem

    Thanks.

  • @jeromealtariba7339
    @jeromealtariba7339 Před 2 lety

    very good thks a lot

  • @CxG8Clan
    @CxG8Clan Před 2 lety

    Got a question: at 6:10, you say we need inheritance because setting a property on a specific element (like a paragraph as opposed to a class) would mean we would not get the properties further down (when setting them for the class), but at 16:00, you've shown the complete opposite. Any clarification would be appreciated!

  • @iftikhar3731
    @iftikhar3731 Před rokem

    Sir kevin you saved my life ❤😊

  • @srinathsri6975
    @srinathsri6975 Před rokem

    Impressive

  • @deatho0ne587
    @deatho0ne587 Před 2 lety +2

    How to simplify old CSS? Should be one of your future topics.
    Some key bullets: Bootstrap that used !important on almost everything and/or it just being on classes it really should not be on. There are 20+ pages and you should really only touch the one you are updating/creating though. Living in the basic looks that the other pages used. Making them responsive for IE and modern browsers without anything that is already in the project. Etc ...
    Another one would be how to limit HTML classes. Example have seen class="col-xs-12 col-sm-12 col-md-6 col-lg-6 col-xl-2 etc". Most of it could have been just dropped down to 3 of the classes in the above example. This is part of the reason I think most dislike frameworks, if the classes on a single HTML element are a paragraph long then I know I dislike HTML.

  • @zaczac7030
    @zaczac7030 Před 2 lety

    Hi. How about putting a empty space (I mean, the space created when we tap the enter button twice) to separate the styling for content and layout? Most of the time we dont need to have sperate selector for each because we usually inherit what the parent is using

  • @laurenwozny2901
    @laurenwozny2901 Před rokem

    Great videos. Very clear to understand. One thing I have a question about though, at 27:44 in Content vs Layout you combine columns and dark-background into one class (that I get), What I'm confused about is why does that override the gap setting in your grid layout? Is it because the gaps ARE still there, but they have now inherited the dark background?

    • @kapurubanda6131
      @kapurubanda6131 Před rokem

      Yes, the gaps are still there, but you can't see it because of the dark background-color, which is now applied to the parent div element by the ".dark-background" class. It's not technically inheritance. You just see "through" the gaps. You can also notice the parent div getting a padding of 1em.

  • @manhloc7784
    @manhloc7784 Před 2 lety

    Hello Kevin, when are you gonna to open course about SASS again, I really want to look in this!

  • @rita1234rita1234
    @rita1234rita1234 Před 2 lety

    if I could give two thumbs up to this video I would!!👍👍👏👏

  • @webapple1
    @webapple1 Před 2 lety

    So iI'm a beginner currently studying web development , Im currently using positioning on my CSS and its actually not so easy , so ima look into grid/flex box because it sounds better than positioning everywhere

  • @bevik12
    @bevik12 Před 2 lety

    I want a video like this but for JS please!

  • @JottyHB
    @JottyHB Před rokem

    Danke!

  • @mih1110
    @mih1110 Před 2 lety +1

    🔥🔥🔥

  • @bobbysilver272
    @bobbysilver272 Před 2 lety +3

    27:45 can anyone explain why " .columns {gap: 1em;} " is no longer working on the grid in the video.

    • @RobertMcGovernTarasis
      @RobertMcGovernTarasis Před 2 lety +5

      it is still working, you just can’t see it because the background of the container div is now black. Previously it was just the boxes in the div that had the dark background so the gap was white. It does raise a question for me though, based on what Kevin said about preferring inheritance … is it better to have the dark background applied to the container, or just to the boxes, or is it one of those “it depends”

    • @eccenux
      @eccenux Před 2 lety +2

      And that also shows another problem that padding should not be in the dark-background class. Because it's a layout thing more then it is about content style.

  • @troy1516
    @troy1516 Před rokem

    whats typically better for making navbars/footers?
    flexbox or grid?

  • @layerseven8755
    @layerseven8755 Před rokem

    What extension are you using to preview your CSS implemented to your web-page in real time?

  • @bryangrante4622
    @bryangrante4622 Před 2 lety

    nice

  • @rajeshnakrani526
    @rajeshnakrani526 Před 2 lety

    Hope you consider uploading to Rumble in addition to CZcams. Love your videos, but I rarely use CZcams anymore.