Learn CSS Calc In 6 Minutes

Поделиться
HTML-код
  • Опубликовано: 15 ноя 2024

Комментарии • 140

  • @shredder_plays
    @shredder_plays 5 лет назад +16

    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 лет назад +4

    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

  • @manpatel6984
    @manpatel6984 3 года назад

    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.

  • @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!

  • @halivudestevez2
    @halivudestevez2 2 года назад

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

  • @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 4 года назад +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

  • @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 :)

  • @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

  • @samsabhaya6686
    @samsabhaya6686 2 года назад +1

    best teacher

  • @josephmawa2793
    @josephmawa2793 5 лет назад +2

    Thanks Mr. Cook for "cooking" these videos.

  • @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...

  • @VIVEKJOSHI05
    @VIVEKJOSHI05 3 года назад

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

  • @sagzone8644
    @sagzone8644 3 года назад

    He deserves many more subscribers...

  • @yashhhh8012
    @yashhhh8012 2 года назад

    Very Easy to Understand, Thanks for great video.

  • @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?

  • @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.

  • @42-velkan-rtx32
    @42-velkan-rtx32 4 года назад +1

    Too right, mate. Very well explained. GJ

  • @shadowwalker9014
    @shadowwalker9014 4 года назад

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

  • @linhdo1738
    @linhdo1738 5 лет назад +3

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

  • @dealstunner8317
    @dealstunner8317 4 года назад +1

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

  • @wixclub
    @wixclub 3 года назад

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

  • @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 4 года назад

      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 =)

  • @owenluna7646
    @owenluna7646 2 года назад

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

  • @suryatejt207
    @suryatejt207 3 года назад

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

  • @tumon001
    @tumon001 2 года назад

    Thanks, Kyle.

  • @ananymo
    @ananymo 2 года назад

    Great video 👍. Thanks 🙏

  • @medusa121
    @medusa121 3 года назад

    helped me alot!!! thanks you so much!

  • @samirsamir7779
    @samirsamir7779 5 лет назад +1

    Great as usually , thanks !

  • @mackynikat8833
    @mackynikat8833 4 года назад

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

  • @fragrantbloom
    @fragrantbloom 2 года назад

    Thank you Kyle

  • @JcBthug
    @JcBthug 3 года назад

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

  • @NoFaceCoder
    @NoFaceCoder 5 лет назад

    Nice simplified technic brother 👍

  • @Zen-lz1hc
    @Zen-lz1hc 2 года назад

    That was neat.
    Thanks for sharing!

  • @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.

  • @Kevinproducciones2
    @Kevinproducciones2 3 года назад

    Thanks bro, your videos are amzing!

  • @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?

    • @cyborgamish
      @cyborgamish 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.

  • @dimerhelpthepoortocode4621
    @dimerhelpthepoortocode4621 5 лет назад

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

  • @naveensinghrana6594
    @naveensinghrana6594 5 месяцев назад

    Great Work.

  • @danielsegewitz6956
    @danielsegewitz6956 4 года назад

    Das Video hat mir sehr geholfen. Vielen Dank

  • @smokazemi
    @smokazemi 3 года назад +1

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

  • @steafansteinocher462
    @steafansteinocher462 Год назад

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

  • @_.sunnyraj._
    @_.sunnyraj._ 4 года назад

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

  • @Beyatilll
    @Beyatilll Месяц назад

    Tysm!

  • @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.

  • @sonamohialdin3376
    @sonamohialdin3376 2 года назад

    Very useful tutorial

  • @hemaldon
    @hemaldon 3 года назад

    thanks for this video

  • @marifat777
    @marifat777 3 года назад

    Hello Kyle can we get your codes from Github

  • @SXCRD
    @SXCRD 5 лет назад

    Love these videos!

  • @sonamuhialdeen7866
    @sonamuhialdeen7866 3 года назад

    So good tutorial

  • @apingsample4720
    @apingsample4720 3 года назад +1

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

  • @ehhh7330
    @ehhh7330 5 лет назад +1

    that bluish greenish color is cyan

  • @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 😥

  • @T25de
    @T25de 2 года назад

    Good shit dude!

  • @Aditya-xz5qv
    @Aditya-xz5qv 4 года назад

    ty!

  • @usama57926
    @usama57926 5 лет назад +1

    amazing thank u so much sir

  • @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.

  • @AbbasAli-yj3fg
    @AbbasAli-yj3fg 2 года назад

    loved it.

  • @JoeWong81
    @JoeWong81 5 лет назад

    Thanks

  • @FirdavsiGameDev
    @FirdavsiGameDev 5 лет назад

    BTW you explain really good!

  • @ronaldrodriguez5144
    @ronaldrodriguez5144 10 месяцев назад

    you're awesome!

  • @Sat123it
    @Sat123it 5 лет назад

    You are great !!

  • @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.

  • @yvng4697
    @yvng4697 Год назад

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

  • @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

  • @NIkFreedomForce
    @NIkFreedomForce Год назад

    THANK YOU VERY MATCH!

  • @FirdavsiGameDev
    @FirdavsiGameDev 5 лет назад

    make more front end projects? and stuff

  • @Kong_PJ
    @Kong_PJ Год назад

    Awesome !

  • @ganipra7402
    @ganipra7402 3 года назад

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

  • @amanmehar8547
    @amanmehar8547 Год назад

    Tq

  • @Popc1007
    @Popc1007 4 года назад

    thnx bro

  • @GingerYu-kt2zb
    @GingerYu-kt2zb 9 месяцев назад

    Very good

  • @kerryd2060
    @kerryd2060 5 лет назад

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

  • @Vietnamcamping89
    @Vietnamcamping89 5 лет назад

    This is so cool 😎

  • @govindsinghrathore4671
    @govindsinghrathore4671 3 года назад

    Done

  • @VideoNOLA
    @VideoNOLA 15 дней назад

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

  • @mysteriousxcodesterio4434
    @mysteriousxcodesterio4434 5 лет назад

    Please, author, add subtitles if you can

  • @RameenFallschirmjager
    @RameenFallschirmjager 4 года назад +4

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

  • @moodymonstrosity1423
    @moodymonstrosity1423 2 года назад +1

    My guy doesn't blink.

  • @hemaldon
    @hemaldon 3 года назад

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

  • @ryomensukuna9513
    @ryomensukuna9513 5 лет назад +2

    First Like Bro👍

  • @syediqbalahmed3176
    @syediqbalahmed3176 5 лет назад

    good

  • @nguyenquocvuong7235
    @nguyenquocvuong7235 2 года назад

    nice

  • @lovekim6838
    @lovekim6838 5 лет назад

    wt. you the best. period.

  • @paulcosta8297
    @paulcosta8297 3 года назад

    Even 2x playback is too slow.

  • @superhusbands5908
    @superhusbands5908 3 года назад

    Oh nooo, where my subtitles?

  • @shahriarmahmudshahed
    @shahriarmahmudshahed 5 лет назад

    Wow

  • @paungster
    @paungster 6 месяцев назад

    👍👏

  • @subham-raj
    @subham-raj 5 лет назад

    ...almost 7 mins :)

  • @guyr989
    @guyr989 5 лет назад

    I learnt it in 3 min. Guess how

  • @АндрейМалинин-м6д
    @АндрейМалинин-м6д 5 лет назад

    Says 6 minutes
    Video lasts 6:41

  • @codewithdoge
    @codewithdoge 3 года назад

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

  • @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.

  • @mehdirohan4248
    @mehdirohan4248 5 лет назад

    2nd comment bro

  • @sauravsahaa
    @sauravsahaa Год назад

    thanks