Position absolute and responsive layouts

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

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

  • @Username-em1oe
    @Username-em1oe Год назад +16

    I just want to say that you are the best educator on CSS. You have given me the ability to understand CSS at a much deeper level. Keep doing what you're doing. It is very much appreciated. Thanks Kevin

    • @clevermissfox
      @clevermissfox Год назад +1

      Seconded! Probably more like 70 thousanth-ed

  • @daveturnbull7221
    @daveturnbull7221 2 года назад +80

    I need to start taking serious notes from your videos. You keep giving us so much info that a lot of it is getting lost in the mess I like to call my brain. Life was so much easier before finding your channel and getting exposed to just how powerfull CSS actually is (not just for setting colours etc). Anyway, I'm off to put in a bulk order for notepads...

    • @KevinPowell
      @KevinPowell  2 года назад +24

      Like Super Mario said, something like Notion might be perfect (it can seem overwhelming because it's so customizable, but there are starter templates for note taking and stuff). It's really handy. I do think written notes are useful too, and I think writing by hand and scribbling out drawings and stuff has a lot of benefits, but being able to quicky reference stuff is always great.

    • @outpost31737
      @outpost31737 2 года назад +3

      Create a folder on your PC/MAC call it something like 'My Webkit' and add your snippets there for easy reference. Works for me :)

    • @cekuhnen
      @cekuhnen Год назад +1

      The nice thing is he comes from print and gets the confusion…

    • @ob5804
      @ob5804 Год назад +1

      ​@@KevinPowellKevin, hello. I have a problem with slider's arrows. When arrows are next to each other, but positioned absolutely, along the container, and when the window is narrowed, the arrows move to the center (Can this approach solve that?

  • @greentea2430
    @greentea2430 2 года назад +6

    Hi, Kevin! Just wanted to say that your style of teaching and explaining stuff is absolutely brilliant, I've been with the channel for 3 months and never missed a single video. It helps me a lot in fighting my anxiety, so thank you very much ; - ).
    It would be wonderful if you could deep dive into the forms in one of the future videos, particularly into the js side of things. It is always so confusing to get forms nice looking and perfectly working, so yeah.

  • @StopLossDill
    @StopLossDill Год назад +1

    Thank you for this. You have helped me more than you could imagine. All my responsiveness-related bugs are instantly fixed after watching this video. This overlapping card concept is so cool. Thanks for years of great content man.

  • @TheMsWrong
    @TheMsWrong Год назад +3

    I used to absolutely dread any time I had to work with position: absolute but you really helped me understand it much better!

  • @leolecee9405
    @leolecee9405 2 года назад +9

    Just as clear, synthetic and practical, as usual 🤓
    And as I'm just tackling my first form / form-validation project, it would be awesome to see your approach to that kind of things.
    Thanks again for everything you're doing 👌

  • @clevermissfox
    @clevermissfox Год назад +2

    I had no idea you could set up your child elements like the name and card number to absolute, and THEN give that parent a positon absolute too. Obvisouly there are specific use cases this would be applied and i try to avoid it but i just assumed if you took off relative from the parent everything would break. This channel is amazing. So generous

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

    I did not know that you can use "position: absolute" and arrange elements relative to it, always did one more wrapper with "position: relative"... Thank so much, you made my life easier

  • @mikefernandez403
    @mikefernandez403 2 года назад +3

    Thank you very much Kevin, I was kind of stuck trying to create a brackground-img for this exercise and you solved all my problems x) I learned so much from your tutorials. Thanks for making people love CSS !

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

    Learning something new from each of your videos. Though the video itself is about position absolute, that “margin-left:auto” trick was really neat. Thanks Kevin!

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

    6:54 - this is the epitome of the meme. "Why does that not work." I love that you left that in.

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

    woooooooww, I just the opened the youtube app on my phone basically to check out tutorials on how people went about working on this card project particularly , not knowing Kevin had worked on it already and has posted it, and I've been on youtube a few times since yesterday, but didn't see this, today that I wanted to search out the problem, kevin's video was the first on my youtube, haven't even searched it already. if this is a sign for me not to give up on coding , I'll think about it. lol, thanks Kev❤

  • @stephanechataignie
    @stephanechataignie Год назад +1

    Great tutorial as usual.
    A full serie for doing a great form with its validation will be great

  • @kirby6362
    @kirby6362 2 года назад +2

    Today I realized that, after watching ~100 Kevin Powell videos, his opening is not “Hello my friend and friends”. 😂
    I always thought it was so cute and personalized that he would greet me as his friend lol

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

    Awesome video. I currently have a project requested by my father. I encountered a problem about layouts and your CSS grid tutorial from a year ago helped me. I still have a page to do that will deal with position absolute and this came in clutch.

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

    Ah yes, absolute positioning... my old arch nemesis. Lots of good stuff in here though that I wasn't aware of. I've been out of the CSS game for a while, only recently dove back in while updating a site I coded years ago. Thanks for the great lesson/overview.

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

    I thought i was already in love with css, but since i discovered your channel i know what it means to really be in love with css. You do a great job and inspire me. Greetings from germany.

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

    As a teacher on different field (insert "c'mon guys, it's not a music theory" meme here 😆 ), I have to say that you nailed it with explanation! Outstanding job! Cristal clear.
    Thank you for all those tutorials!

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

    Thank you so much this has helped me a lot with one of my projects and even the small off-topic note was very helpful to me and taught me something. Thank you for such quality teaching!

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

    Thank you Kevin as always great content

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

    Kevin, I like the fact that some of your video are made to help young developers learn more about the css, but you still end up including some obscure properties without explaining too much about it because it is not the purpose of the video. I consider myself good at css but I clicked the video just in case I'm missing on something and I ended up learning about the "revert" value that you used on the max-width. Your videos never disappoint me, good job and ty for your work! 👍

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

    Thanks, Great guide. It's funny, just as I am working on a similar problem on my projects you come along and put out a new guide solving the issues I'm having lol. Thanks

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

    Another quality demo from Front Ender Mentor. CSS is the Web.

  • @lorenainfanter.3099
    @lorenainfanter.3099 Год назад

    I'm learning a lot with every video you post! Thank you very much!!

  • @NorthTonawanda1
    @NorthTonawanda1 Год назад +1

    There's 3 ways to learn these tricks: (1) Watch the video all the way through (never works.) (2) Watch all the way through, pausing, rewinding, focusing incessantly and spending 3x longer than step one (this kind of works, but not really.) (3) Roll up your sleeves and play along (this works, but you still need to pay close attention.) I need to get better at step 3.

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

    Very interesting and thought provoking. Thanks, Kevin. CSS positioning always seems like Alchemy to me. But I'm slowly starting to wrap my head around it.

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

    Thanks a lot sir...can't control myself to thank you for everything in comment section.

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

    I immediately liked and subscribed your channel, it works like magic. thank you.

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

    Really amazing and very insightful. Been watching your videos and it really has made me fall madly in love with CSS. I'd really love to have another video on creating form.

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

    I was just struggling the whole day keeping the cards in place. Thanks

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

    Everything is related to the parent element...except font-size. That's still in rem.
    With container, that can be done too. I tried it before. It allows us to change the size of the parent element without breaking the layout. Useful to make it a "module" type thing that can change nicely when the designer desides it has to go differently.
    Admitted, that has nothing to do with the subject, position absolute. But it is a nice addition when it comes to the responsive aspect.

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

    I like the way you explain things. You are really helpful. Thanks Kevin :)

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

    Just when I needed this for a project! Thank you Kevin :)

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

    I tried to learn HTML and CSS once. I still know the basics but I don't code anymore. But watching you passionally giving tips to those problems that I once struggle soo much became a strange and satisfactory hobby.

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

      Haha, glad that you're enjoying them! Maybe one day you'll be inspired to make a small little project for the fun of it 😁

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

    awesome kevin, i have learned a lot from this channel.

  • @technoph1le
    @technoph1le 2 года назад +10

    21:00
    Didn't know that `position: absolute` would act as relative to its absolute positioned children. 👍

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

      Yeah, that was a serious departure from my understanding, but lady CSS is actually on our side with that one 🤷

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

    So helpful man... The problem was just solved before finishing the video

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

    This was great and very helpful! Thank you! :)

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

    I appreciate this video so much, thank you kind person! Very useful and easy to follow.

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

    Absolutely brilliant! Please please PLEASE make a video for a responsive CHAT UI

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

    I still use debugging when i want to know what my div for example is doing but the border things is pretty smart, i’ve always done background: red, green etc but borders are a bit less dominant 😂
    I didnt know you could use absolute as a parent i thought everything would break, awesome! Learning new tips bevause ive been away from css is letting me dig deeper into these things you normally never research because you kinda know what relative doesn& what absolute does

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

    It's gonna be cool and very informative if we can continue finish this project sir

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

    Please more on forms!
    I use them a lot in projects and having some fresh ideas would be helpful.

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

    Another legendary project from Frontend Mentor, haha xD

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

    Amazing content. Thank you Kevin!

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

    Actually I am doing project and really stuck in position property and correct time it's help me. Thank you man✨

  • @sukumizune2477
    @sukumizune2477 Год назад +1

    Great tutorial as always. What would you recommend if you needed the positioned elements to scale with the container?

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

    Love this. Solved so many issues.

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

    As always, an excellent demo. In my experience after hours of trying to get "position:absolute" to work (we’ll gloss over the swearing and hair pulling) the solution usually comes down to one question-Have you set or where are you setting position:relative? These days that’s usually the first thing I think about if I’m gonna be using absolutely positioned divs.

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

    23:51 Kev, be careful with the glasses, man. 😆Love your videos, keeup it up!

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

    positionng is such a tiresome process sometimes, great video Kevin, on the question of forms, i have been looking into the proper uses for aria with my code, forms can be improved with aria, so maybe do something on when to use aria in forms

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

    I have learned so much from u
    I can now arrange my flex box very well

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

    Yes let's look at that in the future.

  • @clevermissfox
    @clevermissfox Год назад +1

    I’d be interested in a video looking at revert and initial and their differences ❤

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

    Thank you ! I've got lot of new insights

  • @0xtz_
    @0xtz_ 2 года назад

    I hade this problem just last night 😂😂😂 👌🏼 man u fixed the problem

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

    Perfect! Many thanks!

  • @Sarm8
    @Sarm8 Год назад +3

    Wonderful tutorial! Super informative. Quick question, is there any reason not to put all the elements inside the card image rather than in a parent container?

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

      I was just wondering about the same question 👍 Maybe @KevinPowell can answer this one? 🙏

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

    Love the DFTBA top!

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

    Seriously dog where do you have the microphones. This is super useful right now, thank you!

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

    Thank you for this very valuable video! I have one question though, in 10:16. doesn't CSS rule with (max-width: revert) override the (max-width: 100%) rule for elements of .card-front_bg?

  • @LordBecher
    @LordBecher 2 года назад +2

    Hey Kevin, well done explanations, but could you do me a favor? Surprisingly many people have sight impairments, very often issues with differentiating red and green, could you try to replace one of them in your borders? You are such an educated, helpful person, but I struggle a bit with the visuals sometimes :)

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

      For sure! I try to go with high-contrast colors compared to my backgrounds, but never really took that into accouotn when I should have. Correct me if I'm wrong, but if I avoid reds/pinks/oranges as a rough rule of thumb, it should be alright?

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

      @@KevinPowell I am not that knowledgeable, but I know that red-green color deficiency is by far the most common, 10% of men and 1% of women are affected. In these cases not contrasting red and green is enough already, in more rare forms like color blindness (mono/dichromacy) you'd probably try to use colors with very different hue or saturation, full color blind (achromatic) people can only differentiate the value of the color.

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

    Epic tutorial!

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

    10:18 Why is there space in the bottom of the image? The default display value is "inline". Since there are no other elements in the flow, why is there still distance?

    • @KevinPowell
      @KevinPowell  Год назад +2

      Because it can go inline with text, and letters like j, y, etc have decenders. That space is because it sits on the baseline (the bottom for most letters), and leaves room for those decenders under it. All inline content will have space for the decenders.

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

    Great video as always! Would love to see a full build out video with doing the background on it as well. Any reason you used 960px on the media query? Thought you were only using rem for the most part now.

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

      Fort the media query, I just threw something on there, I sometimes use pixels in more beginner friendly videos to avoid having to talk about it, lol. Using anything other than pixels becomes a sticking point for some, and for media queries, it doesn't make a difference really. The one unit that is the most consistent in media queries is em though, because of a strange zoom thing in Safari, but it's a very small detail

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

    Yes I need this so much tomorrow is the freakin deadline of our project.... 😭

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

    @Kevin Powell please make a video what is the difference between % vs. em font-size

    • @KevinPowell
      @KevinPowell  2 года назад +5

      When used for font-size, they're basically the same thing. 1em = 100%, 1.25em = 125%, etc.

  • @Udaykumar-rt5di
    @Udaykumar-rt5di 2 года назад

    Hey @Kevin Powell your videos are really and really informative. Can you make a video on how should one code thier web app for thier company or bringing it live for other users to use. I heared some stuff like dependenies from my friends but didn't unerstand much about it.

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

    You may be able to avoid the "magic number" in the CVV section by doing bottom: 50% instead of top:44%

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

    Hello Kevin Sir
    i watched most of your videos and learn lots of things about css and html BIG THANK YOU for that
    i have 1 request for you can you make video for responsive website with HTML & SCSS please i want to know how to organize scss files on real world websites.
    thank you;

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

    From where are you getting those projects? I would like to do some designed, instead of designing everything on my own.

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

    Can you make a tutorial on How to be a genius like Kevin Powell next?

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

    what is the reason for "min-block-size: 100vh;" on ".content-grid" ?

  •  2 года назад

    that was very helpful. although I would use background color instead of border or outline color. that way it would not add the border size to the box.

    • @KevinPowell
      @KevinPowell  2 года назад +2

      You can also use outline, just like border but with no actual impact on the size ☺️

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

    Wondering why not using Flex to locate some of the items?

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

    I was told that whwen you go to put a website up, they won't be visible to search engines. I guess we have to insert something into our code, I was told that this was a local plus link? How do we do that?

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

    why do you prefer to use unit rem or em instead of px

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

    If you have heavy elements (i.e., complex svgs or filters), would "transform()" be better for performance?

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

    thank you again sensei

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

    please please please do a video on forms and validation!!!

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

    Question from a new learner, why code all the informaion on the card if you could just upload an img with the credit card information and logo already on it?

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

      Part of this challenge (where I had the "form goes here"), is to make the credit card information update as it's typed into the form, so to do that, it needs to be code :)

  • @lalit-singh-bisht
    @lalit-singh-bisht Год назад

    you are on a whole another level...I just can't keep up with you

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

    An alternative to using img tags
    is using aspect-ratio

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

    Great info.

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

    How did you do the dark mode toggle?

  • @md.ataurrahmansharif5305
    @md.ataurrahmansharif5305 2 года назад

    Thank You very much

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

    Is there a reason you used border instead of outline for the aid of visualization? I feel like you have a video that recommends outline instead of border since outline has less impact on layout.

    • @PP-ss3zf
      @PP-ss3zf 2 года назад

      I agree, I would assume outline shows a more accurate version of the box-model as it is inclusive of the width and height and doesn't add to it.

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

      Outline is probable a better choice, but for larger stuff like this, the couple of extra pixels dive have a huge impact, and sometimes outline ends up outside the viewport on the sides, which isn't a huge deal, but not great for a tutorial. For smaller elements where pixels make a difference, it's a no-brainer though

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

    great content

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

    How do you handle a main-content element being < the height of the window? I have found min-height: 100vh is that okay? I focus on backend development, so css wizardry is confusing and scary

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

      Ideally, min-height: 100dvh, which will adapt to the mobile UI elements that move in/out, but browser support isn't amazing yet, so 100vh is fine for now, unless you run into an issue on mobile that might take a little mucking around to fix

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

      @@KevinPowell thanks. I remember why WordPress was so frustrating back in the day now.

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

    What do you think of tailwind ? I just started to learn it and html looks too messy with tailwind

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

      I'm not the biggest fan in the world :D

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

    The funny thing about websites is that they're responsive by default it's only when we apply our styles that problems occur!

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

    Facebook on profile page while scroll goes to bottom how to position changed on can please make a video on it

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

    this is the best css chanel for peoples whos english is the second language 🤍

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

    'Magic numbery' 🥰

  • @Tony.Nguyen137
    @Tony.Nguyen137 2 года назад

    Hi. Can you make a video about the css property contain? Apparently this css property improves the performance of a website but I don’t understand the documentation :-(

    • @KevinPowell
      @KevinPowell  2 года назад +2

      I was using it today and thought to myself I should make a tutorial on it 😂
      It can improve performance in specific situations, but it's a little niche so I wouldn't worry too much about it

  • @marcorosenbaum9900
    @marcorosenbaum9900 8 месяцев назад

    Nice!

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

    thx kevin :)

  • @ProgrammingTT
    @ProgrammingTT 2 года назад +2

    I make projects using HTML, CSS and JavaScript (with code, for beginners).💻

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

    thank you

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

    tbh as you said
    grid would have been a lot less painful for something like this
    can make this responsive too without using @media
    EDIT: also you can move the card number to center using left: 50%; transform: translateX(-50%);