Master Media Queries And Responsive CSS Web Design Like a Chameleon!

Поделиться
HTML-код
  • Опубликовано: 10 апр 2023
  • 🚨🚨🚨 COURSES - slayingthedragon.io 🚨🚨🚨
    Join the discord - / discord
    You might be wondering why there’s a Chameleon in the thumbnail of this video.
    A Chameleon can change it’s color and pattern - adapting it’s appearance to match it’s environment.
    The chameleon's ability to quickly and seamlessly change its appearance is a skill to be admired - and what I’m suggesting is that we ought to be more like the chameleon when creating our responsive layouts.
    The mobile-first pre-defined media queries:
    /* xs */
    /* @media (min-width: 475px) {} */
    /* sm */
    /* @media (min-width: 640px) {} */
    /* md */
    /* @media (min-width: 768px) {} */
    /* lg */
    /* @media (min-width: 1024px) {} */
    /* xl */
    /* @media (min-width: 1280px) {} */
    /* 2xl */
    /* @media (min-width: 1536px) {} */
    The desktop-first pre-defined media queries:
    /* 2xl */
    @media (max-width: 1536px) {}
    /* xl */
    @media (max-width: 1280px) {}
    /* lg */
    @media (max-width: 1024px) {}
    /* md */
    @media (max-width: 768px) {}
    /* sm */
    @media (max-width: 640px) {}
    /* xs */
    @media (max-width: 475px) {}
    Mobile container utility class:
    .container {
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
    }
    /* xs */
    @media (min-width: 475px) {
    .container {
    max-width: 475px;
    }
    }
    /* sm */
    @media (min-width: 640px) {
    .container {
    max-width: 640px;
    }
    }
    /* md */
    @media (min-width: 768px) {
    .container {
    max-width: 768px;
    }
    }
    /* lg */
    @media (min-width: 1024px) {
    .container {
    max-width: 1024px;
    }
    }
    /* xl */
    @media (min-width: 1280px) {
    .container {
    max-width: 1280px;
    }
    }
    /* 2xl */
    @media (min-width: 1536px) {
    .container {
    max-width: 1536px;
    }
    }
    Desktop container utility class:
    .container {
    max-width: 1536px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
    }
    /* 2xl */
    @media (max-width: 1536px) {
    .container {
    max-width: 1280px;
    }
    }
    /* xl */
    @media (max-width: 1280px) {
    .container {
    max-width: 1024px;
    }
    }
    /* lg */
    @media (max-width: 1024px) {
    .container {
    max-width: 768px;
    }
    }
    /* md */
    @media (max-width: 768px) {
    .container {
    max-width: 640px;
    }
    }
    /* sm */
    @media (max-width: 640px) {
    .container {
    max-width: 475px;
    }
    }
    /* xs */
    @media (max-width: 475px) {
    .container {
    width: 100%;
    }
    }
  • НаукаНаука

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

  • @slayingthedragon
    @slayingthedragon  8 месяцев назад +13

    🚨🚨🚨 New CSS Course - slayingthedragon.io 🚨🚨🚨

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

      :OOOOOOO I really love that idea. Can you tell me if you use both dekstop and mobile containers in one css file or you select based on which design you start first like mobile -> dekstop or dekstop->mobile ?
      P.S. Nevermind you just mentioned at the end + I remembered you mentioned only 6 media queries and if I used both that would be 12.

    • @EtimDavid-rn2o
      @EtimDavid-rn2o 23 дня назад +2

      Nice job man, thanks a lot,
      How did your browser show the screen size, please I need to know?

    • @slayingthedragon
      @slayingthedragon  23 дня назад +1

      @@EtimDavid-rn2o open the chrome dev tools, toggle on the device toolbar, on the top right corners there's 3 dots, click them and select show media queries

    • @officialmoai3107
      @officialmoai3107 3 дня назад +1

      Thanks. ❤️

  • @glaze4629
    @glaze4629 5 месяцев назад +14

    Not only your solution is more elegant, but way easier to understand, I did always struggle with this concept, thank you for such an informative video!!!

  • @aytuncdemir4844
    @aytuncdemir4844 Год назад +67

    you explain things very understandable. it would be really great to see some bootstrap or tailwind or some js framework videos from you.

  • @beanguap
    @beanguap 10 месяцев назад +13

    One of the absolute greatest videos I’ve seen in regards to medía queries. One of the best CSS videos I’ve seen in general

  • @VyrolF
    @VyrolF 2 месяца назад +2

    The way you explain and show things with examples is sooooooo goooood! Congratulations for your hard work on educating us, it’s highly appreciated!

  • @sojimotive7166
    @sojimotive7166 Год назад +66

    Fantastic video! could you make a video too how to use using %, px, em, vh and where to use it on perspective div, parent/children?

  • @henrythomas7112
    @henrythomas7112 24 дня назад +2

    Thanks for the new video! I’m looking forward to seeing what other content you post! Always good to learn as much as you can!

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

    I'm so glad I found your channel! your videos are so engaging and to the point. Thank you so much!

  • @jasonjeong3737
    @jasonjeong3737 Месяц назад +1

    just purchased your course as a refresher for CSS. excited!

  • @Kronical_Lpd
    @Kronical_Lpd Год назад +5

    I've never seen this many chameleons within the first 20 seconds of a video
    All jokes aside tho, amazing video like always.

  • @ShaDoW_T0.
    @ShaDoW_T0. 14 дней назад +1

    i loved your videos bro it was short and simple and most of all it was really helpful

  • @HenryL1606
    @HenryL1606 6 месяцев назад +2

    I just learned how to use media queries thanks to you!!! THANK YOU!😁

  • @DannyH77
    @DannyH77 9 месяцев назад +1

    I'm glad i found this channel. keep up the great work!!

  • @Nob47
    @Nob47 10 месяцев назад +1

    i love you bro i was searching for a tutorial which is to the point and i struck gold on this one

  • @bucketassrabbit1993
    @bucketassrabbit1993 11 месяцев назад +2

    your videos are amazing! thank you for making such high quality content!

  • @moriartythenavigator1945
    @moriartythenavigator1945 13 дней назад +1

    Wow, what a great teacher - I learned what I wanted to know in minutes...I'm going to watch the rest of the tutorial and see what else I can learn. Thanks a lot!

  • @Darius-Paul
    @Darius-Paul 9 месяцев назад +9

    finally someone who knows how to explain , without using fancy language. - all others "beginner" tutorials just gave me a headache. Hats down to you.

  • @boy_deploy
    @boy_deploy 9 месяцев назад +3

    Pure CSS and HTML. I LOVE THIS!

  • @mackenmd
    @mackenmd Год назад +7

    Your presentation skills are second to none! Thank you very much for your very professional work.

    • @matthewnjoroge4759
      @matthewnjoroge4759 11 месяцев назад

      How do i get my browser to show me pixel dimensions?

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

      @@matthewnjoroge4759 see my comment

  • @UwaisLatona
    @UwaisLatona 3 месяца назад +1

    oh my god thank you so much for this, other videos were just complicating things so much

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

    Love your videos! keep them coming.

  • @thebestof_angel8010
    @thebestof_angel8010 8 месяцев назад +1

    This is exactly what I was looking for, life saver thanks man

  • @itsnariah
    @itsnariah 28 дней назад +1

    Found you!!! I've been looking everywhere on how to arrange the elements if I have to view them in mobile and this video helps me so much! Thanks!

  • @rhapsodygrab
    @rhapsodygrab Год назад +6

    You are really always slaying the dragon....keep it up, man

  • @caioresque
    @caioresque 5 месяцев назад +1

    Oh my god, this video that was i need to see. Thank you from Brazil, bro

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

    man you are awesome please make content often.... we can learn a lot and sure... your going to make it a million subs.

  • @ankitpoudel3255
    @ankitpoudel3255 11 месяцев назад +2

    Damn! Incredible content. Definitely, changing the width of 90% in the project I am currently working on!

  • @user-mf5kx4kn8l
    @user-mf5kx4kn8l 9 месяцев назад +1

    Your explanation is great in a very short time. Best on RUclips.

  • @MONGMONG-ep3eb
    @MONGMONG-ep3eb 21 день назад +1

    thank youuuuuuu I've been struggling with my lesson lately and now i understand it

  • @deepjoshi356
    @deepjoshi356 Год назад +16

    There are many solution to a single problem. You have the clarity to choose the best fit. What are the problems are you facing?

  • @OmniOmnium
    @OmniOmnium Год назад +23

    Great video as usual! :)
    I was wondering if you would be interested in creating a video about those "pop in" animations when scrolling down while the elements get visible. That'd be dope, feels like every portfolio piece has them.

    • @slayingthedragon
      @slayingthedragon  Год назад +8

      Sure great suggestion thanks ☺️❤️

    • @roronoazoro3163
      @roronoazoro3163 10 месяцев назад +1

      ​@@slayingthedragoncan you please tell me which website are you using to shrink those size of websites without shrinking the actual chrome page

    • @tuffilaro1565
      @tuffilaro1565 7 месяцев назад

      @@roronoazoro3163 it's a feature of the chrome dev tools. Google: "chrome devtools device mode" to find how to do it. Fyi Firefox also has that feature and it works better there in my opinion because you can also zoom in and out in it by just using ctrl + mouse wheel.

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

      @@roronoazoro3163 Its not a website but dev tools in your browser. Right click, inspect and click on mobile icon on the top. I assume you already found an answer but in case you did not I hope this will help.

  • @ijadjukaj7539
    @ijadjukaj7539 8 месяцев назад +2

    Very nice video as usually, explaining with practical work is very effective... your videos are the most understandable front-end tutorials on youtube in my opinion... I wonder if you do some videos about javascript concepts you would help us because are a little confusing.

  • @chrismachabee3128
    @chrismachabee3128 Месяц назад +1

    I have been trying to understand the mobile design first concept for a while. How the heck do you do that? Yu have just shown me the way. Total brilliant. I go to a lot of instructors to get sorted, without success on this problem, but you were the best teaching the method. The only that took time to explain the difference between Max and MIn and how it relates t mobile first responsive desive. Well done. Now. if you just get the Javascript course done.

  • @user-by6bi8wj3h
    @user-by6bi8wj3h 10 месяцев назад +1

    Informative, helpful and aesthetic 5/5 tutorial. Earned me as a subscriber.

  • @shiba_baig1631
    @shiba_baig1631 4 месяца назад +1

    impressed by your videos extremely smooth and deep explanation...... keep it up!

  • @zafit02
    @zafit02 Год назад +5

    You are the best keep this way you will have millions of views so easy to learn with you

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

    Thanks for sharing your knowledge! Looking forward to your next video :P

  • @KelvinEreremena
    @KelvinEreremena Месяц назад +2

    I love this man. Thank you!!!!

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

    Keep pushing out these contents and you're heading for 1M subs

  • @Bol_imla
    @Bol_imla 6 месяцев назад +1

    great illustration.Keep it up for the wonderful tutorial

  • @AbhinandanMishra1
    @AbhinandanMishra1 Год назад +5

    You're awesome 🎉
    Please make more videos and teach the hard parts of CSS.

  • @TerryLoughran
    @TerryLoughran 6 дней назад +1

    Very cool and so adaptable for all builds. Mobile first all the way 😊 Thanks 👍

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

    Thank you. Your contents are really helpful.

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

    Wow, excellent, thanks again for sharing your knowledge.

  • @Zubair73735
    @Zubair73735 7 месяцев назад +1

    thanks a lot! It helps me a lot

  • @FajarFadhillah-vt4dh
    @FajarFadhillah-vt4dh 8 месяцев назад +1

    This is good and effective, explain something with good visual, i like it

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

    Welcome back 🎉 great video

  • @lastspoil5547
    @lastspoil5547 4 месяца назад +1

    Best video on media query

  • @charlesbrill1531
    @charlesbrill1531 2 месяца назад +1

    thank you deeply from my soul for this video

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

    Thanks for the video ❤

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

    God!
    The Way you explain things....... It just so mind blowing. You have a gift bro, I would seriouly want to learn or have a teacher with even half of your teaching skills.
    You just got yourself a faithful Subscriber. Keep it up bro!!!1

  • @yosefff19
    @yosefff19 9 месяцев назад +3

    You really make coding looks so easy and fun! definitely worth watching every videos of yours! so educational and good for beginners :)) I hope you upload more content

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

    you are doing great bro keep going

  • @DojoDyo
    @DojoDyo 4 месяца назад +1

    another awesome guide STD!! please make more !! HTML and CSS!!

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

    amazing work bro really learned everything clearly💯💯

  • @brandophiri3618
    @brandophiri3618 6 месяцев назад +1

    This guy is actually good

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

    Exceptional video! Could you please make an in depth video about margins, paddings and borders, and in that video also go in depth about nitty gritty stuff like the consequence you've talked about at 8:10? There are many videos about this out there, but none go in depth about the relations and consequences of these properties.

  • @M7D_aska
    @M7D_aska 9 месяцев назад +1

    Could you make a video talking about the differences between normal CSS and tailwind , as well as how much of a difference using JavaScript can make

  • @Evolveado
    @Evolveado 7 дней назад +1

    just AMAZING.

  • @soum-ik
    @soum-ik Год назад +1

    Your video concept is awesome. It very helps full for m. Take love from Bangladesh💖💖, Love you brother. Create this type of video regularly

  • @bobevskiboban
    @bobevskiboban 7 месяцев назад +1

    Salute to you sir, helped a ton

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

    Thanks !! :) amazing video :)

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

    Waiting for this!❤❤

  • @shauryasoni748
    @shauryasoni748 Год назад +4

    Bro please make a full css course with all animations and all please

  • @thelegaldrive
    @thelegaldrive 7 месяцев назад +1

    very useful video, thank you.

  • @fernandosiahaan906
    @fernandosiahaan906 11 месяцев назад +1

    You are a CSS magician

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

    you make great videos bro

  • @samueldayo9261
    @samueldayo9261 6 месяцев назад +1

    I love your teaching your good. Other mentors just type the code you can't even know how. It functions

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

    You're back!

  • @aurorapaisley7453
    @aurorapaisley7453 8 месяцев назад +1

    YOU'RE SO BASED

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

    I subscribe your channel right now
    I love the way that's you teaching
    Please make separate playlists of all
    HTML5 CSS3 and JAVASCRIPT and it's frame works and it's different small projects

  • @benjicanones1454
    @benjicanones1454 11 месяцев назад +1

    Superv explanation!

  • @Shivam-sl4sp
    @Shivam-sl4sp 3 месяца назад +1

    Great explanation as always! btw do you use any extension when you apply media query your dev tools use colors to specify it?

    • @slayingthedragon
      @slayingthedragon  3 месяца назад +1

      Thanks! No I'm not using any extensions, it's all features you can activate on Chrome's dev tools

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

    Display grid or flex with a bit of clamp() will cover most things you are talked about. I am not saying the media query is completely out of the picture though.
    You then have @container queries which are way better than @media, but not 100% supported till about September of this year.
    Yes, stuff like bootstrap and tailwind have to go with @media since they have to be for almost any site out there. They generally are not custom sites though.

  • @JosephCodette
    @JosephCodette Год назад +4

    You could use clamp for responsive sizing .. saves a lot of lines of code

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

    nice video, thks for sharing ! 😘

  • @728sahilpanchbhaiya5
    @728sahilpanchbhaiya5 10 месяцев назад +1

    Earned a subscriber today...❤❤❤

  • @NewbieDev42-it8tg
    @NewbieDev42-it8tg Год назад +1

    Great video

  • @user-xj6fp8mc1o
    @user-xj6fp8mc1o 10 месяцев назад +1

    A Damn good video... this is a damn good video

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

    Best video about media queries my friend ...you should upload more content

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

    I love the intro 😂

  • @ogawde7
    @ogawde7 10 месяцев назад +1

    blessing thats all i can say

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

    Waiting for more videos ☺️☺️

  • @nicklaskragbe1075
    @nicklaskragbe1075 3 месяца назад

    What software are u using to directly switch and view the different breakpoints of your media queries ?

  • @GhsT_-uf4nz
    @GhsT_-uf4nz 3 месяца назад

    what extension did you use for manually adjusting the screen resolution for your website?

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

    Thanks for this great video! Your tutorials are dope! Can you tell me how you got the option to see the dimensions of the screen (top of the screen) without the rest of the Google Dev Tools windows? It would be nice to have an objective preview of the sizes of my screen without the rest of the Dev Tools screwing up my layout preview.
    Also, how did you manage to add those media queries to your browser at 6:09?
    Keep up the lifesaving work!🤟

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

      Thanks !
      Q1: Can you tell me how you got the option to see the dimensions of the screen (top of the screen) without the rest of the Google Dev Tools window?
      A: You can change how the developer tools are opened. I'm assuming your dev tools are opening straight up in your browser, however mine open on a separate window. To do this, you can click on the 3 dots towards the right side of the developer tools, you will find a dock side setting with 4 possible options. If you set your dock side option to "Undock into separate window" your developer tools will now open on a separate window. With this option setup, you will be able to use the mobile view of the developer tools without the actual developer tools interfering with the viewport.
      -
      Q2: How did you manage to add those media queries to your browser at 6:09?
      A: If you look at 6:09 you'll see 3 dots on the top right corner. Clicking on those dots will give you the option to show media queries - just select that option and you'll see the media queries show up like they do on the video :p
      -
      Hope this helped !

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

      @@slayingthedragon Thanks, it really helped! I hope you will release a more in-depth tutorial about using these utility classes you mentioned for responsive design. I think they might solve many issues I have with the responsiveness of the website I am making.