Learn CSS BOX MODEL - With Real World Examples

แชร์
ฝัง
  • เผยแพร่เมื่อ 21 ต.ค. 2023
  • 🚨🚨🚨 COURSES - slayingthedragon.io 🚨🚨🚨
    Join the discord - / discord
    On the web, everything is a box, literally everything. All the elements, the images, the videos, the paragraphs, the headings, entire sections, everything! And with everything being a box, everything has this box-model applied to it. We see, the box model consists of the content, the padding, the border, and the margin.
  • วิทยาศาสตร์และเทคโนโลยี

ความคิดเห็น • 168

  • @XMusicSickness
    @XMusicSickness 3 วันที่ผ่านมา +4

    Hot damn, this guy literally made me understand a concept i was having trouble with for a month in just 17 minutes...

  • @pepitoalmonte1238
    @pepitoalmonte1238 3 หลายเดือนก่อน +51

    Jesus bro, everyone is focusing on making short videos without details, but this 17 min long is worth every second.
    thanks so much.

  • @official_bqpro
    @official_bqpro 18 วันที่ผ่านมา +7

    The Odin Project Brought me here. it was very clear and punctual on point.. Much love form 'South Africa'

  • @niinjablade9369
    @niinjablade9369 2 หลายเดือนก่อน +18

    This is the holy book of CSS Box models, thank you.

  • @dragon_buster_10k
    @dragon_buster_10k 18 วันที่ผ่านมา +3

    Dude, you don't realize how much trouble I've had with resizing buttons, inputs, and other stuff and their true sizes being inconsistent. Thank you so much man!

  • @imuhammadessa
    @imuhammadessa 10 วันที่ผ่านมา +1

    I was struggling to learn how box model work in css and why we use box-sizing property.
    I learned it well today, thank you so much for this ❤️

  • @ride-time
    @ride-time 5 หลายเดือนก่อน +16

    That is by far the best explanation of the box model I've ever seen. Nice work!

  • @sneaksneak6522
    @sneaksneak6522 7 หลายเดือนก่อน +35

    You're such an incredible teacher, I will buy your course, thank you

    • @jayjaayjaaay94
      @jayjaayjaaay94 3 หลายเดือนก่อน

      can you give me the review of the course? I am consider to buying it as backend engineer who dislikes learn css 🥲

    • @sneaksneak6522
      @sneaksneak6522 3 หลายเดือนก่อน

      ​@@jayjaayjaaay94 I really enjoyed it. If you like his teaching style here on youtube, you will enjoy the course. It doesn't teach you absolutely everything, but in my case it took me from not understanding CSS and hacking my way through it, to being confident enough to use it with little effort

  • @badcatdesign
    @badcatdesign 7 หลายเดือนก่อน +56

    I use the mnemonic of “TRouBLe” to remember the order of Top Right Bottom Left. Keeps me out of TRBL 😂 Thanks for the video.

    • @olufemiajibade
      @olufemiajibade 6 หลายเดือนก่อน +5

      😂 going clockwise works for me

    • @christopherkallas9305
      @christopherkallas9305 4 หลายเดือนก่อน

      HAHAHAHA

    • @rajatkatal9311
      @rajatkatal9311 4 หลายเดือนก่อน

      For Me clock is a good reference 😂

  • @SuperDarmino
    @SuperDarmino 7 หลายเดือนก่อน +11

    i cant unhear Border-Box in Slay's voice 😭😭

  • @tevfik7
    @tevfik7 22 วันที่ผ่านมา +1

    You are a great teacher bro. You have a new sub. Keep them coming.

  • @magnumjade45
    @magnumjade45 หลายเดือนก่อน +2

    such a great teacher. im dumb af but you made me understand box model in 17 min. thank you so much.

  • @rb2k197
    @rb2k197 4 หลายเดือนก่อน +7

    Wow you explained this a lot better, I am doing some online boot camp and i get confused by this margin, padding, and elements and you help me understand it.

  • @rileylavonne8863
    @rileylavonne8863 2 หลายเดือนก่อน +3

    Worth watching the whole thing. Speed it up if you want, but don't skip this one! Thanks!!!!!

  • @manuelk64
    @manuelk64 4 หลายเดือนก่อน +5

    this video is sponsored by... myself! 😀

  • @richardsinclair7661
    @richardsinclair7661 3 หลายเดือนก่อน +1

    Thank you so much. You've been the best that I've found at explaining CSS in a way that is both clear and straightforward.

  • @mattnj8080
    @mattnj8080 4 หลายเดือนก่อน +2

    Your videos are great. I love the tips that go beyond just showing how it works. This is the first time I've heard of border-box which helped me a lot as I was always doing math before and layouts were confusing.

  • @rickyp9803
    @rickyp9803 5 หลายเดือนก่อน +3

    Excellent, excellent, excellent, explanation. Thank you very much, you've made clear a whole bunch of things that I as a beginner studying web development, have been trying to figure out and no other video was able to explain it as you do in this one.
    For example, what does the box and it's sections in the developers tools mean, as well as how to use and understand the box model in the developer tools.
    You have given me a clear understanding of that tool.
    Again, muchísimas gracias.

  • @RancorSweetly
    @RancorSweetly 7 หลายเดือนก่อน +4

    I didn't even realize I needed to know this thank you!! Great video start yeah! 🔥

  • @kmarafatislam8403
    @kmarafatislam8403 5 หลายเดือนก่อน +3

    You explained it really well. Thank you so much.

  • @johnmellet6610
    @johnmellet6610 5 หลายเดือนก่อน +3

    Thank you so much genuinely I am busy building my first survey form and i thought i kind of understood padding and margin but this video has completely changed everything for me with css! I was really struggling picked up html strait away and i can style with css, i have only been learning a week but this has broken it all down and elaborated on all the elements thank you so much!!

    • @johnmellet6610
      @johnmellet6610 5 หลายเดือนก่อน

      tell you what here is my current html and css code so you can take a look and when I finish it you can see how much you have helped xD
      HTML


      Survey Template Project


      Template Survey Form
      [Insert text here]


      Enter your first name:
      Enter your last name:
      Enter your email:
      Enter your number:


      Select option:

      (Please select)
      Option 1
      Option 2
      Option 3
      Option 4




      Please select one (required)
      Yes!
      No!


      What would you like to see improved?(Check all that apply)
      Selection 1
      Selection 2
      Selection 3
      Selection 4
      Selection 5
      Selection 6
      Selection 7


      Additional information
      Any additional info:
      Add am image:




      This page was created by John Mellet
      If you would like to see more projects of mine click Here
      © 2023 Example Company. All rights reserved.

      css
      body {
      width: 100%;
      height: 100vh;
      }
      .br {
      background-image: url('stock.img');
      height: 100%;
      background-position: center;
      background-repeat: no-repeat;
      background-size: cover;
      }
      h1, p {
      margin: 1em auto;
      text-align: center;
      font-family: Helvetica;
      }
      form {
      width: 60vw;
      max-width: 1200px;
      min-width: 300px;
      margin: 0 auto;
      font-family: sans-serif;
      font-size: 16px;
      color: #e7e1db;
      background: rgb(0,0,0);
      background: linear-gradient(90deg, rgba(0,0,0,1) 0%, rgba(5,4,75,1) 16%, rgba(41,11,190,1) 52%, rgba(0,0,0,1) 95%);
      }
      fieldset {
      border: none;
      padding: 2rem 0;
      border-bottom: 5px solid;
      }
      label {
      display: block;
      margin: 0.5rem 0;
      }
      footer {
      color: whitesmoke;
      font-family: Times New Roman, Times;
      }

  • @RancorSweetly
    @RancorSweetly 7 หลายเดือนก่อน +3

    UNIVERSAL STAR SELECTOR 9:50 this is something I actually really needed but had no idea it existed. Thank you! 🙏🏼

  • @SirenSeph
    @SirenSeph 25 วันที่ผ่านมา +1

    greatest explanation of CSS Box Models tysm ily

  • @Chiaros
    @Chiaros 7 หลายเดือนก่อน +6

    Adding sections to the video's timeline would be nice, like in older videos.

  • @mykelcee
    @mykelcee 6 หลายเดือนก่อน +5

    Never fail to amaze me with your teaching skills.

  • @Cosmolgy24
    @Cosmolgy24 หลายเดือนก่อน +1

    You helped me out so much! Thank you for making quality content.

  • @DnsError80710102
    @DnsError80710102 2 หลายเดือนก่อน +1

    Yes "we see" how helpful this explanation was no fluff thank you so much!

  • @MrVipulLal
    @MrVipulLal วันที่ผ่านมา +1

    Clear explanation. Thanks

  • @dramamania6899
    @dramamania6899 6 หลายเดือนก่อน +2

    Your teaching skills is just amazing ❤. I learnt many things from you. Thank you bro ❤

  • @ShawnX1995
    @ShawnX1995 หลายเดือนก่อน +1

    very detailed and simple examples. I appreciate you for creating that content.♥♥

  • @Yesterday_i_ate_rat
    @Yesterday_i_ate_rat 7 หลายเดือนก่อน +2

    Thank you so much for this amazing video, ❤ everything is clear now

  • @lunarskyye2680
    @lunarskyye2680 หลายเดือนก่อน +1

    Wow. Now this is a cracking tutorial. I understood everything until the 2nd reset you did with pseudos. Maybe because I haven't looked at before and after yet.
    Brilliant tutorial.

  • @clueless1434
    @clueless1434 หลายเดือนก่อน +1

    Awesome stuff, explained very well like all the rest of your content.

  • @prasadranjansikdar6127
    @prasadranjansikdar6127 หลายเดือนก่อน +1

    You really explained it so simply.. Thanks for the lessons it really means a lot for the ones similar like me who are struggling to understand and implement.

  • @ramune_flowers
    @ramune_flowers 2 หลายเดือนก่อน +1

    Just learned about this in my course and was getting so confused by the explanation. Thanks for keeping it short and concise, it's actually not that hard!

  • @sureshkumar3217
    @sureshkumar3217 6 หลายเดือนก่อน +2

    I am doing css and I love this video

  • @DeanCohenOfficial
    @DeanCohenOfficial 6 หลายเดือนก่อน +2

    Best video I have seen about this topic.

  • @Betterdays1996
    @Betterdays1996 20 ชั่วโมงที่ผ่านมา +1

    Thank you so much for this one 💖

  • @marabdiaziiz961
    @marabdiaziiz961 7 หลายเดือนก่อน +2

    i really enjoyed the video thanks man

  • @daniajahanzaib5626
    @daniajahanzaib5626 6 หลายเดือนก่อน +2

    really nice way of explaining CSS. Easy to remember

  • @flp905
    @flp905 2 หลายเดือนก่อน +1

    the way you teach is flawless :)

  • @00SecretAgent
    @00SecretAgent 4 หลายเดือนก่อน +1

    @SlayingTheDragon
    ...
    Finally, someone I can hear, understand, and follow all in one box..!

  • @NiceChange
    @NiceChange 6 หลายเดือนก่อน +2

    Yup...Another great video. nice details. Thanks.

  • @lexxthetech_
    @lexxthetech_ 3 หลายเดือนก่อน +1

    you just saved my life. THANK YOU.

  • @varswe
    @varswe 7 หลายเดือนก่อน +2

    Here comes the legend, to slay the dragon CSS

  • @musicbutlyrical6380
    @musicbutlyrical6380 3 หลายเดือนก่อน +1

    You really are the best one on this platform....Great Work!!

  • @Lian-zb5rk
    @Lian-zb5rk 6 หลายเดือนก่อน +2

    i have stumbled upon a gold mine of content

  • @rtx__3090
    @rtx__3090 7 หลายเดือนก่อน +2

    Clockwise was nice concept

  • @ARULVENDHAN-up8fq
    @ARULVENDHAN-up8fq 12 วันที่ผ่านมา +1

    Extraordinary teaching ❤

  • @Dungeon_Synth_Enjoyer
    @Dungeon_Synth_Enjoyer 7 หลายเดือนก่อน +2

    Yep, you are a very good teacher, thanks a lot.

  • @taufiq6329
    @taufiq6329 2 หลายเดือนก่อน +1

    no one does it better than you my king😊😊

  • @yokk0
    @yokk0 7 หลายเดือนก่อน +2

    love from brazil

  • @FallenAngelMMA
    @FallenAngelMMA 7 หลายเดือนก่อน +2

    Thank you so much!

  • @dannygarcia8012
    @dannygarcia8012 2 หลายเดือนก่อน +1

    Very informative, thanks! 👍

  • @fase8729
    @fase8729 2 หลายเดือนก่อน +1

    I appreaciate your labor dude

  • @miikoa
    @miikoa หลายเดือนก่อน +1

    Your video is liquid gold:) Thank you🙏

  • @rakibul98
    @rakibul98 5 หลายเดือนก่อน +2

    explained very well

  • @riyadhossain7854
    @riyadhossain7854 6 หลายเดือนก่อน +3

    Love your videos bro! Could you make a video about the Git commands you use and why you use them in what situations?

  • @Sebastian-lc4nh
    @Sebastian-lc4nh 7 หลายเดือนก่อน +4

    Love youuu from my inner soul❤

  • @chrisbartkowski375
    @chrisbartkowski375 3 หลายเดือนก่อน +1

    thanks man, very helpful, very clear.

  • @jha-bhaskar
    @jha-bhaskar 3 หลายเดือนก่อน +1

    Great Explanation ❤

  • @menachemlevi
    @menachemlevi 6 หลายเดือนก่อน +3

    just subscribe well explained

  • @gabrielrinconlopez9241
    @gabrielrinconlopez9241 7 หลายเดือนก่อน +2

    Thanks a lot for the class ;).

  • @uridevmedia
    @uridevmedia 3 หลายเดือนก่อน +1

    This is very descriptive thanks ✌🏼

  • @KarthikKollur-ky3iw
    @KarthikKollur-ky3iw 6 หลายเดือนก่อน +2

    thank u so much man

  • @NAFIZALRAKIB
    @NAFIZALRAKIB 7 หลายเดือนก่อน +2

    web legend is back with a fire video. 😅 You are awesome brother

  • @c28ccd0e
    @c28ccd0e 6 หลายเดือนก่อน +2

    Everything is smooth now after doing the CSS reset !

  • @xonic7852
    @xonic7852 29 วันที่ผ่านมา +1

    Extremely nice video!

  • @rakeshislammolla7201
    @rakeshislammolla7201 3 หลายเดือนก่อน +1

    You are creating great content ❤

  • @rejuzaman6365
    @rejuzaman6365 6 หลายเดือนก่อน +2

    You're a legend❤

  • @Zoyo77
    @Zoyo77 19 วันที่ผ่านมา +1

    Thank you for the video simple with lot of information جزاك الله خيرا

  • @vivekpoojary265
    @vivekpoojary265 6 วันที่ผ่านมา +1

    good job, very useful content , thank you so much

  • @charlestoneoyoo
    @charlestoneoyoo 4 หลายเดือนก่อน +1

    Thank you for this explanation

  • @undeadqug7732
    @undeadqug7732 หลายเดือนก่อน +1

    bro you are the GOAT

  • @pushyanth1223
    @pushyanth1223 3 หลายเดือนก่อน +1

    super explanation kudos to you

  • @Macj707
    @Macj707 2 หลายเดือนก่อน +1

    Great Video... I am going to share it... that is good that you can use * to remove the margin I didnt know that! CHEF CRISP WUZ HERE!

  • @rahulrahul6259
    @rahulrahul6259 3 หลายเดือนก่อน

    Wow , Thanks a lot it covered many things which I don't know ❤❤❤

  • @menachemlevi
    @menachemlevi 6 หลายเดือนก่อน +2

    love you from israel and you have a really calm voice

  • @sharath.m
    @sharath.m 7 หลายเดือนก่อน +4

    Can you make a video on margin collapse property

  • @chenbruce2428
    @chenbruce2428 27 วันที่ผ่านมา +1

    learn a lot thanks

  • @rajbhushan3541
    @rajbhushan3541 23 วันที่ผ่านมา +1

    perfection

  • @altayeb913
    @altayeb913 5 หลายเดือนก่อน +2

    Really really well explained, can the next topic (if and hopefully there will be) be about {border-image, conic gradient} and some not very beginner-ish topics.

  • @shangeevanMukunthan
    @shangeevanMukunthan หลายเดือนก่อน +1

    Thank you brother

  • @PraveenKumarJha-xc6ie
    @PraveenKumarJha-xc6ie 26 วันที่ผ่านมา +1

    nice video sir.i appreciate your efforts to make us understand the best

  • @hoagiesupreme
    @hoagiesupreme หลายเดือนก่อน +1

    I hope you get rich one day teaching stuff. You're great at it.

  • @blakeclark8622
    @blakeclark8622 7 หลายเดือนก่อน +3

    Thanks!

  • @halcyon__r3289
    @halcyon__r3289 7 หลายเดือนก่อน +2

    Didnt know about the default margin

  • @its_mah_way2717
    @its_mah_way2717 3 หลายเดือนก่อน

    Hello sir, thank you so much for this amazing tutorial, looking forward to more such amazing content... Best regards 😃

  • @trocandobytes
    @trocandobytes 24 วันที่ผ่านมา

    Your videos are very concise and helpful ! I was wondering if you could make tutorials on how to make complete website layouts, with different templates covering the most used ones. You could make use of flex or grid to make they adapt nicely on any divice, depending of the layout, and using the correct semantics. Could you ?

  •  หลายเดือนก่อน +1

    I LOVE YOU!!!!!!!!!!!!!!

  • @Bingbangbong28
    @Bingbangbong28 7 หลายเดือนก่อน +2

    awesome

  • @kenanklovitch8117
    @kenanklovitch8117 4 หลายเดือนก่อน +1

    Wow, I am barely above a novice but I understood that (I think). Thank you.

  • @basmalabasmala7176
    @basmalabasmala7176 3 หลายเดือนก่อน +1

    the best one eveeeeeeeeeeeeeeeeeer

  • @PascalHorn
    @PascalHorn 7 หลายเดือนก่อน +5

    I can see a star selector to reset padding and margin, but I have my doubts about resetting box-sizing to all elements.
    The problem occurs, when you insert widgets or other code from a third party, that uses padding without specifying a border-box. It can break their intended box model for their widgets. An at least not uncommon occurrence I have to fix from time to time. I’d use it with caution.

    • @slayingthedragon
      @slayingthedragon  7 หลายเดือนก่อน +3

      This is valid honestly, well said.

    • @MurkyTy
      @MurkyTy 6 หลายเดือนก่อน +5

      For situations like this, you can simply see if it breaks, and then override the border-box with your content-box instead. These resets save you time 95% of the time, and I think is a reasonable reset to keep for all projects.

  • @SRG-Learn-Code
    @SRG-Learn-Code 7 หลายเดือนก่อน +3

    In your webpage, the javascript course overflows the element within the 1024px media query. Seems like the grid is forced too much .
    @media (min-width: 1024px)
    .Courses_item2__LS7ps {
    grid-area: 1/5/3/-1;
    }

  • @ahmedghallab5342
    @ahmedghallab5342 4 หลายเดือนก่อน +1

    شكرا Thanks that was helpful

  • @fatemeetsluck
    @fatemeetsluck หลายเดือนก่อน

    This was extremely helpful. I'm trying to make a sort of Bible study note HTML app sort of thing that can display the text on one side and the annotations on the right, all without using deprecated HTML elements such as "frame".

  • @rejoiceokafor5988
    @rejoiceokafor5988 3 หลายเดือนก่อน

    You're good❤🔥

  • @thatoneshortkidjordy2144
    @thatoneshortkidjordy2144 7 หลายเดือนก่อน +2

    fire video 😎

  • @BibekGotame
    @BibekGotame 4 หลายเดือนก่อน +2

    Post some video myan. Eagerly waiting for