HTML & CSS for Beginners Part 18: How Floats and Clears work

Поділитися
Вставка
  • Опубліковано 9 лют 2025

КОМЕНТАРІ • 250

  • @lawrenlelko
    @lawrenlelko 5 років тому +90

    "There's really no analogy for this... that's why the whole thing falls apart." LOL Seriously, you're the best teacher I've found in over 3 years! You don't waste my time with things no one uses, but you include the foundation that is required for what is used.

    • @hanielarindel1408
      @hanielarindel1408 5 місяців тому

      Yeah, it's good to learn the foundations. Honestly I wanted to know how float works just to work with the text side of floats, not for layout.

  • @inkscapebyamir1337
    @inkscapebyamir1337 4 роки тому +58

    This is absolutly the best explaintion of the floating i've ever seen on youtube so for, Thanks a lot

  • @sravanteja3909
    @sravanteja3909 3 роки тому +27

    Dude you made my day.
    I started learning html and css today and guess what?
    I stuck on that float and clear thing.my instructor told me not to worry about it this early.but i have a habit of understanding everything in my way and only then move forward.
    You are an awesome person. thanks a lot man.
    If possible pls make a video on text alignment.
    Take care...

  • @CMDonovann
    @CMDonovann Рік тому +1

    wow, this might be the first time i've ever been able to actually understand what's going on with floats. showing the items under each other with the transparency really helps. thanks!

  • @sarahayman3506
    @sarahayman3506 4 роки тому +14

    I was terribly confused about that topic in particular and it's so clear for me right now! , thank you for that great clear explanation Mr. Kevin

  • @bz6304
    @bz6304 4 роки тому +5

    I had difficulties understanding float and clear concepts in my coding bootcamp, and this video really helps me a lot. Thank you for all your awesome videos and great work. Two thumbs up

  • @michaelangelos5117
    @michaelangelos5117 Рік тому

    This series is not only good for beginners, but someone like me who has experience in CSS but wants to quickly review or reference. Thanks

  • @yudianyuan3353
    @yudianyuan3353 4 роки тому +3

    Thanks a lot! I have seen several tutorials, but it's only until yours that everything becomes so clear!

  • @andreas_bergstrom
    @andreas_bergstrom 5 років тому +37

    Been doing web development since the early 00's, and this always confused me until now. Thanks!

    • @pearlsswine
      @pearlsswine 4 роки тому +3

      LOL. I could literally place a $10,000 bet on every web dev tutorial video on YT having at least one comment that has a comment like yours on it.
      "This video ClEaRs ThInGs Up So MuCh". These comments are so predictable, quite useless (since they're usually coming from extremely amateur "developers" who would think a literal pile of vomit is a good tutorial video) and annoying.

    • @andreas_bergstrom
      @andreas_bergstrom 4 роки тому +20

      @@pearlsswine sorry to disappoint you with my useless comment. :( I will surely think twice next time I’m about to write a comment so that it adds enough value to not make you upset if you come across it. Because one should expect high quality comments when browsing through UA-cam.

    • @RyantheCanuckpirate
      @RyantheCanuckpirate 4 роки тому +4

      @@andreas_bergstrom your comment was way better than his. What did his even add? Just negativity lol
      And he picked a weird comment to reply to seeing as you said you've been doing it for 20 years

    • @anoblefish411
      @anoblefish411 3 роки тому

      ​@@pearlsswine yeah, this barely explains a thing, it starts slow with something seems like a good explanation and then in the part where it need explanation he just go like "yeah, it's like that because it's like that". the floor is made out of floor, no sh1t.

  • @pythusiast4701
    @pythusiast4701 3 роки тому

    You are the most intelligent and born front-end developers I have ever seen. You explain everything so nice man. You are awesome. AWESOMEEEEEE!!!!!!!

  • @scodemy1976
    @scodemy1976 5 років тому +3

    just started my wed development channel but your channel has really improved my coding skills

  • @juancaca1993
    @juancaca1993 2 роки тому +3

    For those who are new to this, Grid is the way to play around with boxes, or maybe flexbox. Float is really old and not easy to understand at first :v

    • @sebastiangonzales46
      @sebastiangonzales46 2 роки тому

      True but it's also cool to learn the "old way" even tho its not efficient just knowing the foundation and all

  • @thePOWERofART-11
    @thePOWERofART-11 3 роки тому

    no need for an analogy, you took it step by step, i followed and understood. good job cheers

  • @apoorvgupta9680
    @apoorvgupta9680 5 років тому +1

    I present you the CSS professional of the Decade award.congrats

  • @2006glg
    @2006glg 6 років тому +11

    Great video Kevin. You earned a faithful subscriber.

    • @KevinPowell
      @KevinPowell  6 років тому +1

      Thanks so much for subbing, really glad that you enjoyed the video!

  • @saurabhraj201
    @saurabhraj201 4 роки тому

    Oh Dear.. This is absolutely the best explanation ever on floats and clears.. Huge dopamine released after watching this video. Thank You so much Kevin.

  • @digigoliath
    @digigoliath 5 років тому +2

    Good explanation with good examples to illustrate the implementation & control of Float. Much appreciated by a newbie to CSS!

  • @saugatnepal5956
    @saugatnepal5956 2 роки тому

    Hands down the best video on this topic.

  • @erikaq765
    @erikaq765 Рік тому +1

    Wow, excellent video! Thank you for the clarification!!

  • @shanekaio665
    @shanekaio665 3 роки тому

    the cloud analogy works if you use clear to imply things below need to 'clear out' because the cloud is beginning to rain and things don't wanna be under it getting wet! your videos are so great, float and clear finally make sense!! and now I realize I'm using floats when I don't need to 😂

  • @donbroccoli4274
    @donbroccoli4274 4 роки тому +6

    Thanks for the explanation! Very well explained. Your analogy with the cloud is not that bad:
    clear means the element wants clear sky above, so it wont move underneath a cloud/floating object.

    • @ummi7292
      @ummi7292 2 роки тому

      Woah !!! That's an awesome one

  • @techbhupi9398
    @techbhupi9398 4 роки тому

    after watching this video ,first thing i did was to subscribe your channel! Thanx a lot for this love from INDIA

  • @mayankmahajan9451
    @mayankmahajan9451 4 роки тому

    I made a promise to myself that I WILL BE THE MOST SUCCESSFUL WEB DEVELOPER !Then it is becoming a dream come true for your videos !!!

  • @ibrahimalsahary2954
    @ibrahimalsahary2954 5 років тому +2

    Thanks a lot, Kevin. This is really amazing lectures and useful for me (I am your student at RTC to pass the exam tomorrow.

  • @nathalieferreiraBR
    @nathalieferreiraBR 2 роки тому

    I'm leaving my house now, to workout and than come back and watch this all over again... For me this got a little confusing LOL Also I saw that you have another video about it. I will be watching this too. maybe when I get more familiar with this subject I will understand it better...

  • @icreatestuff3610
    @icreatestuff3610 5 років тому +1

    The absolute best explanation I've come across thanks!

  • @morgancastro2924
    @morgancastro2924 7 років тому +4

    First time I've been confused so far haha not your fault, just the concept, like you said, is a little weird but this series is amazing and I'm learning so much, thank you!

    • @KevinPowell
      @KevinPowell  7 років тому +2

      Yeah, floats are super strange, probably because they were never intended for creating layouts. I should update this series to include very basics of flexbox, it's less confusing (though can be more complicated, just because it has so many properties).

  • @qasn
    @qasn 4 роки тому

    thiss was the helpfullest video of my life and it helped my site a lot and my buisnes you are the best

  • @redbeardjunior
    @redbeardjunior 4 роки тому

    YOU are my hero of the day !!! clear: both !!! saved me today ~~~~~ !!!!

  • @fullStackInKannada
    @fullStackInKannada 5 років тому +6

    Thank you so much! It helped me a lot especially "clear: both;". :)

  • @mayab4770
    @mayab4770 2 роки тому +3

    Kevin, thank you soooooooo much for your explanation about floats!! Since it is tough to compare this concept to anything in real life, what I do in this case is create a STORY. So when you make a box float left for example, there is like a huge invisible magnet that pulls the box. And the second the box is pulled, the boxes below take advantage and push each other up behind the box being pulled. The other boxes are like monkeys wanting to eat Pacman hehehehehehe And float clear makes boxes behave like they don't give a damn about anyone but themselves and want to stay on their own.

    • @riyatiwari7178
      @riyatiwari7178 2 роки тому

      Haha, thank you for putting the story here, Maya. :D

  • @SmokyBigSmoke
    @SmokyBigSmoke 4 роки тому +2

    This is a beautiful explanation.Thank you so much.

  • @jonnysegway7866
    @jonnysegway7866 Рік тому

    This course is 6 years old, this lesson is probably the one that has aged the most, especially with Flexbox available now

    • @KevinPowell
      @KevinPowell  Рік тому +1

      100% agree, and one of the reasons that I'd like to re-do this playlist!

  • @victorisrael6191
    @victorisrael6191 3 роки тому

    When he said "it's really weird" i just felt so happy and not alone😂😂

  • @amanshaw5846
    @amanshaw5846 4 роки тому

    About Floating.. all my doubts are cleared now....Thanks a lot sir

  • @TheGaqqq
    @TheGaqqq 2 роки тому

    You are the best teacher! thank you so much!

  • @RyanFromUltrasound
    @RyanFromUltrasound 4 роки тому +1

    Extremely helpful. I learned flexbox and grid, but was never exposed to floats. Feels good to catch up :)

  • @alleefattah8045
    @alleefattah8045 4 роки тому

    Very elegant explanation

  • @BomToxhall
    @BomToxhall Рік тому +2

    Are you able to show your HTML layout for 9:13 onwards? Thanks

  • @dankonia182
    @dankonia182 3 роки тому

    Спасибо!

  • @ades3967
    @ades3967 5 років тому +2

    6:58-7:07 great explanation!

  • @Uncle_Benn
    @Uncle_Benn Рік тому

    Damn Kevin i feel like seeing the Matrix... Many many thanx from Athens Greece!!!!

  • @commentymccommentface6597
    @commentymccommentface6597 4 роки тому +1

    OMG I finally understand what's going on with floats! Can anyone else hear those angels singing? :D Thanks!

  • @attamjotsinghkhurana4473
    @attamjotsinghkhurana4473 4 роки тому +2

    Very informative and concise video 👍👍

  • @WONGTZEHANGUPM
    @WONGTZEHANGUPM Рік тому

    I'm definitely gonna have to revisit this one!

  • @ig1988ig1988
    @ig1988ig1988 Рік тому

    You Sir are a legend :) i first learnt about Flex then about grid (and thought grid is kind of complicated) then i found this video and thought WTF :D Floats and Clears? why i need this when i have flex and got frustrated whats the difference between all these 3 :) and then i found your video " Floats, Flexbox, Grid? The progression of CSS layout" i havent watched it yet but i know it will answer my questions :)

  • @jonathan-uwagboepromise3139
    @jonathan-uwagboepromise3139 3 роки тому

    Gosh.
    I love your videos
    On point. Thanks Mr Kevin.

  • @eduardoburquezsanz1910
    @eduardoburquezsanz1910 3 роки тому

    Subscriber No. 413,001 starting from this video right now

  • @ezquerzelaya
    @ezquerzelaya 4 роки тому +2

    so easy to understand! thank you a lot!

  • @Blackdiamond929_
    @Blackdiamond929_ 2 роки тому

    So helpful and you have a nice voice ☺️☺️.... lol I need to watch again 🤣

  • @JamesxBond007
    @JamesxBond007 2 місяці тому

    best analogy is.. well, floating (with some sinking). The paragraph box is a body of water, and the pink box - when set to float - sinks into the water and starts floating right under the surface. Unless the tank sets clear - which is like an ice layer on top - and nothing can sink into it (and thus float in it). :D

  • @SamCo99
    @SamCo99 3 роки тому

    killing it as usual!

  • @yadikishameer9587
    @yadikishameer9587 2 роки тому +2

    I know flexbox and grid soo good that I never bothered using float 😊

  • @mitchellorutu1893
    @mitchellorutu1893 2 роки тому

    Amazing explanation!...Thank you very much... already shared your channel with my network

  • @sainithinkumar2888
    @sainithinkumar2888 2 роки тому

    Beautiful Course! Thank You Mr.Kevin

  • @emmanuelagwu2953
    @emmanuelagwu2953 2 роки тому

    Thank you so much for this great tutorial.

  • @gamersylum3674
    @gamersylum3674 5 років тому

    Hey Kevin how r u? I hope you'll be fine.
    My name name is shyam from India, I have just learning web development and I was confused with the CSS stuffs but after watching your videos. I have cleared so many things. You are doing a good job thank you so much.
    I liked the part that you have created video topic vias . 😊

  • @MrRasZee
    @MrRasZee 4 роки тому +1

    w0w these vide0s are s0 helpful.. thanky0u sir..

  • @oneaboveall7489
    @oneaboveall7489 5 років тому

    one of the best explanation

  • @minezgio3175
    @minezgio3175 4 роки тому

    Thanks man , I finally understood this stuff.

  • @BeeshoStudying
    @BeeshoStudying 2 роки тому

    you are the best. thanks you for the amazing explanation

  • @zoominedits770
    @zoominedits770 2 роки тому

    thank you a lot for this series

  • @raghulg6155
    @raghulg6155 5 місяців тому +1

    SIMPLE EXPLANATION:
    Imagine like you 2 layers one behind another. The foremost layer doesn't have anything and the background layer has 5 boxes arranged vertically like shown in this video. Once you do float:left for box1 then the box1 comes to the foremost layer... and all the other boxes in the background layer moves up vertically takes the space left by the box1.
    Now if you do float:left for box2 then the box2 comes to the foremost layer.. and all the other boxes in background layer moves up and takes the space left by the box2 and so on..

  • @iamDBK
    @iamDBK 4 роки тому

    best explaination ever....thanku so much

  • @peternydahl6150
    @peternydahl6150 3 роки тому

    Fantastic, thanks a lot! 👏 Cheers from sweden! 😊

  • @TheTyronesf
    @TheTyronesf 4 роки тому

    Great job, wish you were on Udemy. I came here because the instructor told us just to read about it. lol Thanks again!

  • @hsiang-yehhwang2625
    @hsiang-yehhwang2625 2 роки тому

    It is so CLEAR!!
    Thanks!!!!!

  • @StrangeIndeed
    @StrangeIndeed 4 роки тому

    I regret that I didn't see this video few months ago, when I was starting to learn intermediate CSS

  • @Bjorn808
    @Bjorn808 2 роки тому +1

    Are these things I should know or should I just stick with things like flexbox? Thanks for the explanation

  • @ubkvybz
    @ubkvybz Рік тому

    This guy is just too good 😮

  • @dipakyadav3487
    @dipakyadav3487 5 років тому

    Love from India, one request.. please make a habit of sharing the source code of everything you code.

    • @KevinPowell
      @KevinPowell  5 років тому +2

      This was the first videos that I made, most of my new content has all the code shared :)

  • @davidlira8853
    @davidlira8853 5 років тому

    Good explanation brotha. I like how you explained it with the red and blue boxes.

  • @avishek_ataur
    @avishek_ataur 3 роки тому

    2:45 -only left & right, 3:45 -wonderful, 5:45

  • @kabukijoe99
    @kabukijoe99 3 роки тому

    Спасибо (Thank You). Good English and good lesson

  • @CirTap
    @CirTap 2 роки тому

    Everyone should have that in their design tools arsenal. However, for several years after Kevin posted this gem, Flexbox, display:inline-block and even position:absolute do many of the things demoed at the beginning, just with their own intentionally different side effects on the elements involved.
    Doing layout with floats has always been considered a hack. It wasn't designed for that. Today you should use Grid and/or Flexbox to do layout jobs, big and small (try inline-grid, inline-flex).
    Understand the layout problem you want to solve first, THEN pick the right tool that gets you the result with as little to no side effects possible.

  • @Music-sj2xy
    @Music-sj2xy 2 роки тому

    confused me left to right definatly will come back to this and revise but a
    good lecture

  • @thstudio007
    @thstudio007 4 роки тому +1

    Nicely explained! Thank you so much :)

  • @dimosthenistsigouris379
    @dimosthenistsigouris379 3 роки тому

    hello.I'm a little bit confused.While using the clear property with the "right" value you said that if there is nothing floating on the right side then nothing happens (14:45).But actually there are floating items, specifically the rest of the boxes. So why nothing is happening?Hope you can understand the reason i am confused and thank you in advance!

  • @athisii_ekhe6167
    @athisii_ekhe6167 4 роки тому

    nice explanation.

  • @TinyMaths
    @TinyMaths 3 роки тому

    Well, I came here because I didn't understand why my text wouldn't appear lower down the screen after I floated a my list and logo which were typed higher up in the HTML document. As soon as you said it 'floats' above the text, like, up in the air, I laughed; and the point got through. I'm realizing it's as important to understand how these tags are operating as it is to know what they do. Those two goals seem like the same thing; but your video shows they are not because there's what seems to be happening on the face of it; but what's also going on that I missed.
    I guess, in a crude way, maybe in this instance the 'clear' command might be viewed as finding a spot of sunshine that's not in the cloud's shadow, it is 'clear' of the area underneath the cloud. If you were far enough above the clouds, you would be able to see anything that 'clears' the area beneath the cloud... crude I know, but that's how I interpreted what you were saying (that satisfies me for now). Anyway, thanks, this really helped in solving a few issues I've had for the last few days.

  • @sunriseeternity300
    @sunriseeternity300 4 роки тому

    Thank you. Great Video

  • @mahdiyealimohammadi568
    @mahdiyealimohammadi568 3 роки тому

    thanks for the explanation!

  • @JazzFanss
    @JazzFanss 2 роки тому

    This is so cool!

  • @flamingobird8513
    @flamingobird8513 6 років тому

    Excellent explanation. Thank you.

  • @thamzhu
    @thamzhu 4 роки тому

    well done, very useful. Thanks alot

  • @scottsmyth1862
    @scottsmyth1862 3 роки тому

    great vid man thanks

  • @ShubhamKumar-gk2wl
    @ShubhamKumar-gk2wl 4 роки тому

    Excellent 👍👍👍

  • @nadadishouAr
    @nadadishouAr 2 роки тому

    thanks for your help , but i wish u can confome if I understood one point right, if we used the cleaar element it stops the float from all elements which have texts, and keep it on any other elemnt with no texts?

  • @aleshamccown2095
    @aleshamccown2095 4 роки тому

    Thank you! Great video!

  • @sarakakitani1890
    @sarakakitani1890 2 роки тому

    If you don't know how to create those box, you can use :
    :)

  • @troyeinstein9487
    @troyeinstein9487 Рік тому

    Hi, thanks a bunch for this video. You are a true savior.. Just started learning web dev on my own and got a little frustrated with CSS due to manipulations like this. For example: Why box five got cleared together with the rest of the boxes after it, when they had been assigned a "left" float valu which made them line up at the top (first row)?? Is it because the boxes after it now have a new float reference, which is box-5?

  • @rrbeccahart89
    @rrbeccahart89 5 років тому

    This was SUPER helpful thank you!!!

  • @abhinavbhargavareddyedulak4936
    @abhinavbhargavareddyedulak4936 4 роки тому

    I SWEAR TO FUCKING GOD this explanation is what I NEEDED

  • @nothing9854
    @nothing9854 6 років тому +1

    Thanks from Morocco 👍

  • @ifzo123
    @ifzo123 5 років тому +1

    Hey Kevin, thanks very much for that lesson. Kind an abstract thing those floats and clears.. Please consider making a video about "inline-block" and similar to it.. Once again thx million you're doing that great videos. They help a lot! :)

  • @zachfenton608
    @zachfenton608 3 роки тому

    great example

  • @chaitanyakadwasra4929
    @chaitanyakadwasra4929 Рік тому

    Hi Kevin, first of all, thank you so much for the videos, and secondly, is it still relevant to learn 'Floats and Clears' in 2023?

  • @goldensleeves
    @goldensleeves 2 роки тому

    So the float is like where you want to float something like a cloud out of the page. But "clear" ensures that whatever would otherwise be under the floated object will, instead, have a clear sky above it by moving down away from the shadow of that cloud.

  • @zulhilmisuhaimi9616
    @zulhilmisuhaimi9616 2 роки тому

    this help me! thank you

  • @EmiliaKaida
    @EmiliaKaida 3 роки тому +2

    I heard this guy is a CSS master of sorts, but after watching this vid, I must say he's really not doing the job right.
    We don't need to hear you mumbling about stuffs being hard and all. 1-2 minutes about that, who cares? We came here to watch the tutorial and learn something new, of course the topic is hard, you don't need to repeat that or say off-topic stuffs.
    For the right-on video about this topic, check out Steve Griffith's video. You'll be amazed how well he did it!