Learn CSS Calc In 6 Minutes

Поділитися
Вставка
  • Опубліковано 14 гру 2024

КОМЕНТАРІ • 140

  • @shredder_plays
    @shredder_plays 5 років тому +17

    just love these kind of short videos make more such like these.

  • @Fresteeyles
    @Fresteeyles 5 років тому +15

    Wow, I really didn't know about css variables. This is extremely useful!

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

    Css is so underestimated but on the latest years grew so much, is insane what you can do with it

    • @WebDevSimplified
      @WebDevSimplified  5 років тому +4

      It is incredible. CSS was one of the things that made me really love web development.

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

    Your tutorials always short give the answer I need to and in simplified way, keep it up

  • @88dejw
    @88dejw 5 років тому +15

    calc solved for my problem with keeping footers stuck to the bottom on different viewports. Just add this to Your main content class: .content { min-height: calc(100vh - [footer height]px); }

    • @paolo-1283
      @paolo-1283 5 років тому +1

      Yup calc is awesome but what if the footer's height is not fixed how do you subtract it? Here's a better solution for example you want a 3 column layout, a header, content and the footer that sticks to the bottom even if there's little to no content at all. With CSS grid you can set .app{ display: grid; grid-template-rows: 100px 1fr auto; height inherit} provide the body's height is 100% or 100vh

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

      @@paolo-1283 Keeping it absolute and bottom: 0px woudn't be a better approach? Grid template always comes out as troublesome and too verbose for me.

    • @paolo-1283
      @paolo-1283 4 роки тому

      @@ralpholiver2889 the key too solving problems with grid is the align-content center and align-content start

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

      @@paolo-1283 but flex does that too, with less verbosity.

    • @paolo-1283
      @paolo-1283 4 роки тому

      @@ralpholiver2889 yeah i agree, flex is one dimensional, grid is two

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

    best teacher

  • @42-velkan-rtx32
    @42-velkan-rtx32 4 роки тому +1

    Too right, mate. Very well explained. GJ

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

    I literally watched the Kevin Powell one he did and told him I was dissapointed he didnt talk about the space on 2:51 that you did lmao I love you guys you two are my favorite to watch online for html css and js :)

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

    Man you videos are excellent! And so are you :)

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

    Great as usually , thanks !

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

    Your video helps me update my outdated css-html knowledgebase.

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

    Very Easy to Understand, Thanks for great video.

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

    You made my day....Thanks love from India.

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

    Thanks Mr. Cook for "cooking" these videos.

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

    He deserves many more subscribers...

  • @Zen-lz1hc
    @Zen-lz1hc 2 роки тому

    That was neat.
    Thanks for sharing!

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

    Your videos are soooooo easy to understand, thank you a loooooot

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

    helped me alot!!! thanks you so much!

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

    whenever I come to your videos. You send me to learn something else, which will send me to another video. But let's be honest. WEB DEV SIMPLIFIED is just THE BEST. period.

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

    Love these videos!

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

    Great video 👍. Thanks 🙏

  • @naveensinghrana6594
    @naveensinghrana6594 6 місяців тому

    Great Work.

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

    Nice simplified technic brother 👍

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

    Amazing bro, thanks a lot. I learn a lot from you

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

    I have a jumbotron that would not work until I made the height = height: calc(1 * calc(.5 * 100vw)); I have never used calc before, but now I think it really is magic! Glad this tutorial was available to help me. Thanks!

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

    CSS was always so boring for me, I never tried to learn it in depth. Your videos making me in love with css, thank you

  • @forgiveness_denied
    @forgiveness_denied 5 років тому +58

    bruh I didn't even know that CSS Vars exists :D

    • @WebDevSimplified
      @WebDevSimplified  5 років тому +12

      They are pretty amazing!

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

      Me too neither!

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

      @@WebDevSimplifiedbut Sass is much more powerful when it comes to using variables, is it not ?

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

      You prolly dont care but if you are bored like me during the covid times then you can stream pretty much all of the new movies on instaflixxer. Have been streaming with my gf these days xD

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

      @Jaxxon Jason Definitely, I've been watching on instaflixxer for months myself =)

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

    Thanks bro, your videos are amzing!

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

    tnx for the info 6mins vid and really got it man.

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

    Das Video hat mir sehr geholfen. Vielen Dank

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

    Good shit dude!

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

    Great explanation! I must remember to use calc. The only thing missing was some mention of browser support (or lack thereof).

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

      Good point. Calc is pretty much universally support except in Opera mini and some edge cases in IE.

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

      @@WebDevSimplified CSS variables seem to have slightly less support, i.e. none in IE.

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

      @@bertilow If anyone is still using IE 11 or earlier, then they don't deserve to be on your website :) Question is what about Edge...

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

    Thanks, Kyle.

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

    Very useful tutorial

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

    Thank you Kyle

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

    Awesome work! ....I always thought I could only use variables in sass :( Thank you!

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

    Tysm!

  • @samsilarefeen2466
    @samsilarefeen2466 3 роки тому +1

    Awesome explanation in a very short video . Liked it.
    Okay, I have a question. If I declare a variable in css with calc() , how can I call the variable in javascript?

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

    So good tutorial

  • @smokazemi
    @smokazemi 3 роки тому +1

    Hello,thank You! how can I have something like this: calc( 200px * 1600px / 1500px )?

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

    Hi Guru, Please make some videos on event loops . How different tasks are executed in loop. How to create new loop etc. your simple ways are really great. Thanks a lot.

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

      That's a good suggestion. I will add it to my list.

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

    thanks for this video

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

    Brother this is really awesome and easy to understand nice work 👍😊

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

    Do you have a video of how to calculate the margin paddings values?

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

    You are great !!

  • @AbbasAli-yj3fg
    @AbbasAli-yj3fg 2 роки тому

    loved it.

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

    Awesome !

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

    BTW you explain really good!

  • @ronaldrodriguez5144
    @ronaldrodriguez5144 11 місяців тому

    you're awesome!

  • @Aditya-xz5qv
    @Aditya-xz5qv 4 роки тому

    ty!

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

    amazing thank u so much sir

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

    calc function :
    1). 2 different unit
    2.) CSS variable (--x, root)

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

    Please show us how to give a card drop-down a position in a view port/scroll-view

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

    I love your videos buddy..... As a web developer i too more interested and have passion to do videos like you.. May be in future i will make videos which are very inspired to me.

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

    Thanks

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

    First Like Bro👍

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

    This is so cool 😎

  • @RameenFallschirmjager
    @RameenFallschirmjager 5 років тому +4

    css variables!!!!!! I feel like finding alien life!😂

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

    wait, why in 5:17 container have red color?
    isn't in 4:41 he delete container css?

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

    Kyle, is it possible to append units to unitless numbers through calc()? I've read it's possible by multiplying the unitless number by 1 and putting the desired unit next to the 1. It's possible with all units except "%", because calc() would determine the percentage instead of just adding the unit to the number. I know SASS does allow this, but CSS doesn't, which is unfortunate 😥

  • @GingerYu-kt2zb
    @GingerYu-kt2zb 10 місяців тому

    Very good

  • @_.sunnyraj._
    @_.sunnyraj._ 4 роки тому

    I had no idea before this that calc function also exist in css

  • @Andre-zp6qq
    @Andre-zp6qq 4 роки тому +1

    Hey, first of all, amazing videos. You actually make me want to keep on learning this.
    Anyway, what’s the difference between making a variable in :root {} or anywhere else? Is root like the “base”, where you set the variable’s initial value and then can alter it later on?

    • @ffxim
      @ffxim 3 роки тому +6

      Old question, but... CSS custom properties are scoped. Setting/resetting a custom property somewhere makes it available for all descendants. Defined in :root, it will be available everywhere.

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

    Love this video, really easy to understand and straight to the point! :) thanks!

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

    WOW!! This is great. I see myself using this. (-:

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

    thnx bro

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

    Hello Kyle can we get your codes from Github

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

    Can you include current css properties of elements? For example: left: calc(this.left - 100) px; EDIT: I just read your comment that calc cannot know the current size of an element.

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

    I'm just learning about css variables and calc and seeing them together is great. I'm having an issue I hope you can help with - I have a div that the user can resize using javascript, and I want the font inside it to grow and shrink to fit into the div. So say div is 200x50 and font-size is 16px can I use css to calculate the new font size using calc() as the user changes the dive to say 400x100. Thanks, great work though!

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

      This is going to be really tough to do since all fonts are different sizes and fonts themselves have different sizes of each character. For example the text lllll will take up less room than OOOOO.

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

      @@WebDevSimplified I thought it might be, I was thinking for the starting size you have a font-size of 14px and then calculate it based on width/height of the div from the stating values. but not sure you can use the current width and height in the calc function...

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

      @@harag9 You cannot use the current size of something in the calc function. CSS does not know of the current size of objects.

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

    Not tried, but what if -hew in :root is set less than 180?? Don't know if negative values in hue also work

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

    Tq

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

    i swear every question I have he got a video on dat joint

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

    My guy doesn't blink.

  • @Carl-yu6uw
    @Carl-yu6uw 5 років тому

    Interesting, you have a tut website, which is good as you are super clear and concise in your presentations. The pricing seems a little too ambitious tho, given there are some very good courses and tutors who undercut you. Hmmm.

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

      I totally understand. There are a lot of good cheap courses out there, but I feel that my course is concise and well explained enough to justify the higher price, especially considering the amount of free content I have to back it up.

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

    make more front end projects? and stuff

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

    that bluish greenish color is cyan

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

    THANK YOU VERY MATCH!

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

    Done

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

    i really hate calc coz its kinda hard, can i stick with the other units?

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

    nice

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

    good

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

    wt. you the best. period.

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

    calc(calc(calc(100% * 2) / 10) + 10px) ? not working! why?

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

    Please, author, add subtitles if you can

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

    Wow

  • @paungster
    @paungster 7 місяців тому

    👍👏

  • @VideoNOLA
    @VideoNOLA Місяць тому

    More correctly, "That's the first 1/10th of what there is to know about the CSS calc() function."

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

    I learnt it in 3 min. Guess how

  • @subham-raj
    @subham-raj 5 років тому

    ...almost 7 mins :)

  • @АндрейМалинин-м6д
    @АндрейМалинин-м6д 5 років тому

    Says 6 minutes
    Video lasts 6:41

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

    Oh nooo, where my subtitles?

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

    2nd comment bro

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

    I hope my gf doesn't see your video.... You are too handsome

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

    Even 2x playback is too slow.

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

    If you change your thumbnail you'll get more views.

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

      What do you recommend I change it to. I am pretty terrible at thumbnail design, and people at least know that this type of thumbnail is my style.

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

      I did a quick youtube search and I found that most type of these vids have the same thumbnail which is understandable but we can all agree that they were not eye appealing (catchy)! I can help you design thumbnails if you want to.

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

      @@ko3li668 If you want to help send me an email at the email on the about page of my channel.

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

    thanks