CSS Media Queries & Responsive Web Design tutorial for Beginners

Web Dev Roadmap for Beginners (Free!): bit.ly/DaveGrayWebDevRoadmap
Learn CSS media queries and responsive web design for beginners in this tutorial. A CSS media query is capable of changing your page design and presentation based on different screen and browsers sizes.
🚩 Subscribe ➜ bit.ly/3nGHmNn
🚀 This lesson is part of a CSS for Beginners tutorial series playlist:
• CSS Tutorials for Begi...
🔗 All Resources for this CSS Tutorial Series: github.com/gitdagray/css_course
📬 Course Updates ➜ courses.davegray.codes/
CSS Media Queries & Responsive Web Design tutorial for Beginners
(00:00) Intro
(00:05) Welcome
(00:26) Starter Code
(01:26) Viewport meta tag
(02:48) Syntax of a media query
(03:28) Think mobile first
(05:53) Other query types and breakpoints
(07:11) How to choose breakpoints
(10:25) Build a basic page layout
(16:11) Add a media query
(17:49) Use dev tools to view different screen sizes
(20:41) Add all media queries
(24:14) View each breakpoint change
⚙ Web Dev Tools:
🔗 Chrome Browser: www.google.com/chrome/
🔗 Visual Studio Code (VS Code): code.visualstudio.com/
🔗 Live Server VS Code Extension: marketplace.visualstudio.com/...
🔗 vscode-icons VS Code Extension: marketplace.visualstudio.com/...
🔗 Github Themes VS Code Extension: marketplace.visualstudio.com/...
🔗 W3C CSS Validator: jigsaw.w3.org/css-validator/
🔗 Specificity Calculator: specificity.keegan.st/
🔗 HTML Special Characters and Entities: unicode-table.com
🔗 CanIUse.com: caniuse.com/
📚 References:
🔗 MDN CSS: developer.mozilla.org/en-US/d...
🔗 MDN CSS Basics: developer.mozilla.org/en-US/d...
🔗 MDN CSS Selectors: developer.mozilla.org/en-US/d...
🔗 MDN - How to Apply Colors to HTML Elements with CSS: developer.mozilla.org/en-US/d...
🔗 MDN - CSS Values and Units: developer.mozilla.org/en-US/d...
🔗 MDN - The Box Model: developer.mozilla.org/en-US/d...
🔗 MDN - Styling Lists: developer.mozilla.org/en-US/d...
🔗 MDN - Display Property: developer.mozilla.org/en-US/d...
🔗 MDN - Floats: developer.mozilla.org/en-US/d...
🔗 MDN - Columns: developer.mozilla.org/en-US/d...
🔗 MDN - Margin Collapsing: developer.mozilla.org/en-US/d...
🔗 MDN - White-Space: developer.mozilla.org/en-US/d...
🔗 MDN - Positioning: developer.mozilla.org/en-US/d...
🔗 MDN - Flexbox: developer.mozilla.org/en-US/d...
🔗 MDN - Basic Concepts of Grid Layout: developer.mozilla.org/en-US/d...
🔗 MDN - Grid Template Areas: developer.mozilla.org/en-US/d...
🔗 MDN - CSS Images: developer.mozilla.org/en-US/d...
🔗 MDN - CSS Background Images: developer.mozilla.org/en-US/d...
🔗 Chip Cullen - Article on Content Layout Shift: chipcullen.com/what-width-and...
🔗 MDN - CSS Media Queries: developer.mozilla.org/en-US/d...
✅ Follow Me:
Github: github.com/gitdagray
Twitter: / yesdavidgray
LinkedIn: / davidagray
Blog: yesdavidgray.com
Reddit: / daveoneleven
Was this tutorial about CSS Media Queries and Responsive Web Design helpful? If so, please share. Let me know your thoughts in the comments.
#css #media #queries

Пікірлер: 80

  • @DaveGrayTeachesCode
    @DaveGrayTeachesCode2 жыл бұрын

    CSS Media Queries are essential for Responsive Design. This tutorial looks at everything from the basics of media queries to how to choose your media query breakpoints when applying responsive design to your web pages. If you're just getting started with CSS, I recommend going to the start of this CSS for Beginners playlist: kzread.info/head/PL0Zuz27SZ-6Mx9fd9elt80G1bPcySmWit

  • @obeng-yeboahk.d1914
    @obeng-yeboahk.d191410 ай бұрын

    I never understood media queries until now.. thanks Dave

  • @kaurmanjot
    @kaurmanjot Жыл бұрын

    Thank you so much Dave for this amazing video 😊

  • @JESUSISGOD9334
    @JESUSISGOD933410 ай бұрын

    love this, this was so help full

  • @marie-elizeventer7080
    @marie-elizeventer7080 Жыл бұрын

    Thank you so much for taking the time to make these tutorials Dave. This one has been super helpful in helping me understand media queries

  • @DaveGrayTeachesCode

    @DaveGrayTeachesCode

    Жыл бұрын

    Great to hear!

  • @laszlotabor
    @laszlotabor Жыл бұрын

    You just helped me out so much Dave... I was struggling for a half day when I bumped into your vid...things clearing up now! Thx mate!

  • @DaveGrayTeachesCode

    @DaveGrayTeachesCode

    Жыл бұрын

    Glad it helped!

  • @Biikashkumar
    @Biikashkumar Жыл бұрын

    Hi Dave, Thanks for your great tutorial. I was confused which video to chhose for media query. However, as I saw your name and my previous experience of watching your vidoe in freecodecamp, i blindly choose your video. I glad that I didi it. Thanks once again.

  • @nextlevelMiracle45
    @nextlevelMiracle452 жыл бұрын

    Brilliant tutorial. Thank Dave!

  • @DaveGrayTeachesCode

    @DaveGrayTeachesCode

    2 жыл бұрын

    You're welcome! 💯🚀

  • @CTILET
    @CTILET2 жыл бұрын

    Hi Dave! Thanks for your work!

  • @DaveGrayTeachesCode

    @DaveGrayTeachesCode

    2 жыл бұрын

    You're welcome! 🙏

  • @dzutest5343
    @dzutest5343 Жыл бұрын

    I definitely think you have given the right key to many researching online. This is a super tut👍

  • @DaveGrayTeachesCode

    @DaveGrayTeachesCode

    Жыл бұрын

    I appreciate that! 🙏💯

  • @AdamChou-mu3ow
    @AdamChou-mu3ow4 ай бұрын

    What a beginner-savior(babysitter-level) content!!🤩It covers all I needed!!! 😭Thank you very much!! Hopes for sequels!!!🙌👐

  • @DaveGrayTeachesCode

    @DaveGrayTeachesCode

    4 ай бұрын

    Glad it was helpful!

  • @hiwayshoes
    @hiwayshoes2 жыл бұрын

    Hi Dave! Lovely tutorial, media queries have always been a pain point for me, but you’ve cleared things up immensely. As always, you provide many opportunities for practice… Cheers 💖!

  • @DaveGrayTeachesCode

    @DaveGrayTeachesCode

    2 жыл бұрын

    Thank you for the kind words, and glad I could help! 🙏💯

  • @dzutest5343

    @dzutest5343

    Жыл бұрын

    makes two of us

  • @edithsylvester1311
    @edithsylvester1311 Жыл бұрын

    crystal clear. thank you!

  • @DaveGrayTeachesCode

    @DaveGrayTeachesCode

    Жыл бұрын

    Glad it was helpful!

  • @mohamedabdelrazig6920
    @mohamedabdelrazig69202 жыл бұрын

    Oh my god you’re honestly so amazing for uploading this so fast!!! Thank you so much!! Any chance you can cover the final topic of transformations & animations ? That would be so amazing!! Also on a sidenote I will most definitely support this channel when i land my first job you should start a patreon! :)

  • @DaveGrayTeachesCode

    @DaveGrayTeachesCode

    2 жыл бұрын

    Thank you, Mohamed! I have a few more topics to cover including transform and animations. Thank you in advance for the support 🙏🙏

  • @adamovtimur98
    @adamovtimur982 жыл бұрын

    Hi Dave I just want to say thanks a bunch for your tutorials :)))

  • @DaveGrayTeachesCode

    @DaveGrayTeachesCode

    2 жыл бұрын

    You're very welcome! 🙏

  • @harold.machado
    @harold.machado19 күн бұрын

    Thanks a lot....

  • @101stDay
    @101stDay2 жыл бұрын

    Fantastic explanation! I also use the whitesmoke named color a lot!

  • @DaveGrayTeachesCode

    @DaveGrayTeachesCode

    2 жыл бұрын

    Thank you, Neil! 🙏 I do like that color 💯

  • @Grihlo
    @Grihlo2 жыл бұрын

    Thank you for another lesson!

  • @DaveGrayTeachesCode

    @DaveGrayTeachesCode

    2 жыл бұрын

    You're welcome!

  • @powerfulspirit9242
    @powerfulspirit92422 жыл бұрын

    Hi Dave🙏 I have been following you from html. Your videos are awesome 👌. I must be lucky to find you. 🙂🙂🙂

  • @DaveGrayTeachesCode

    @DaveGrayTeachesCode

    2 жыл бұрын

    Thank you! 💯

  • @verydifferentthought
    @verydifferentthought Жыл бұрын

    u are very good teacher, i am literally watching this from Uzbekistan :)!

  • @DaveGrayTeachesCode

    @DaveGrayTeachesCode

    Жыл бұрын

    Thank you! And hello to you in Uzbekistan! 👋

  • @CTILET

    @CTILET

    Жыл бұрын

    Me too)

  • @balogunadetunji546
    @balogunadetunji546Ай бұрын

    Wow best class it was strange at first but I enjoy it ❤️❤️❤️❤️😊😊

  • @hadibq
    @hadibq Жыл бұрын

    Great teaching skills ! Thanks for sharing! new sub indeed!!

  • @DaveGrayTeachesCode

    @DaveGrayTeachesCode

    Жыл бұрын

    Welcome aboard!

  • @sumeyyea
    @sumeyyea2 жыл бұрын

    omg İ think you read my mind i need to study of responsive design nowadays and bumm your video came on me, thank you Dave!

  • @DaveGrayTeachesCode

    @DaveGrayTeachesCode

    2 жыл бұрын

    Glad I could help! 🚀

  • @roydeloiza6663
    @roydeloiza6663 Жыл бұрын

    This is amazing!

  • @DaveGrayTeachesCode

    @DaveGrayTeachesCode

    Жыл бұрын

    Glad I could help!

  • @marwaka
    @marwaka Жыл бұрын

    the best tutorial i have watched

  • @DaveGrayTeachesCode

    @DaveGrayTeachesCode

    Жыл бұрын

    Thank you!

  • @olamilekanolajide1622
    @olamilekanolajide1622 Жыл бұрын

    Thank you😊

  • @DaveGrayTeachesCode

    @DaveGrayTeachesCode

    Жыл бұрын

    You're welcome 😊

  • @subhamprasadbhagat4527
    @subhamprasadbhagat4527 Жыл бұрын

    Hello Dave, Greetings for the day! I have been watching your videos and these are really awesome and helpful. I have one question and I need one clarification. Clarification - @time-stamp 16:40 - you said it will be valid upto 576px, but in the output it is reflecting from 576px. As there we are designing for small screen, shouldn't we use max-width:576px, instead of min-width? There is some confusion in that section of the video. Question - when we write (orientation: landscape), will that work for any mobile device in landscape and even in tablet landscape? Please explain, Thank you. :)

  • @yucelbengu1307
    @yucelbengu13072 жыл бұрын

    Omg! another amazing video thank you so much Dave I'm from Turkey even I don't have enough english ,I can understoon clearly :)

  • @DaveGrayTeachesCode

    @DaveGrayTeachesCode

    2 жыл бұрын

    Happy to help! 💯

  • @ahmad-murery
    @ahmad-murery2 жыл бұрын

    I don't know why but it's easier to me to design using desktop-first method and then squish things down to fit smaller screens (maybe it's the type of apps I accept), anyway, if we don't need to center things vertically we can get rid of the 3 grid related properties, Thanks Dave, great tutorial as usual,

  • @DaveGrayTeachesCode

    @DaveGrayTeachesCode

    2 жыл бұрын

    Thank you, Ahmad! 🙏💯

  • @championsleague2696
    @championsleague26962 жыл бұрын

    i just completed the HTML 4 hours tutorial Including the Projects. Looking forward to starting this Css tutorial with you.

  • @DaveGrayTeachesCode

    @DaveGrayTeachesCode

    2 жыл бұрын

    Great job! I'm still building the CSS playlist, but there is currently 17 lessons and over 6 hours in there. 🚀

  • @esraamohamed5601
    @esraamohamed5601 Жыл бұрын

    Thank you

  • @DaveGrayTeachesCode

    @DaveGrayTeachesCode

    Жыл бұрын

    Welcome!

  • @kevink3072
    @kevink3072 Жыл бұрын

    I have just done a refresher about web responsiveness and media queries and am happy to go to sleep. Thanks, dave!

  • @DaveGrayTeachesCode

    @DaveGrayTeachesCode

    Жыл бұрын

    Excellent!

  • @stormbytes
    @stormbytes Жыл бұрын

    Outstanding presentation

  • @DaveGrayTeachesCode

    @DaveGrayTeachesCode

    Жыл бұрын

    Thank you! Cheers!

  • @Manny.Angulo
    @Manny.Angulo2 жыл бұрын

    Hi Dave! I finished the HTML 4 hour course and now im working on the CSS course. I created a blog and im updating it little by little with everything I learn from these videos. What should we move on to after this CSS course? Thank you for all your work by the way.

  • @DaveGrayTeachesCode

    @DaveGrayTeachesCode

    2 жыл бұрын

    Nice work! 💯 I recommend building a few projects to reinforce your skills so you are on the right path. I am still adding to this CSS playlist each week, too. After HTML and CSS, it is time to learn JavaScript. I recommend my full JS course here: kzread.info/dash/bejne/d5p1zpubp928is4.html

  • @kiddofrancesco1622
    @kiddofrancesco1622 Жыл бұрын

    Good content! My question is when you use activate landscape mode naturally what it means is that the height and width have been interchanged so do we need to consider the max-height in terms of portrait or landscape vice versa?

  • @DaveGrayTeachesCode

    @DaveGrayTeachesCode

    Жыл бұрын

    No the height and width are also inversed.

  • @tabarna2364
    @tabarna23642 жыл бұрын

    Hi Dave, I finished your 4h html5 course and I'm about to finish your css course as well. But what I want to say is I dont want to use javascript on my projects because of privacy concerns probably my targets will be disabled js on their browsers. Any chance to make fully functional web apps or websites ? maybe with server side languages ? I would be very happy if you could suggest me somethings. Also if you could create a community on discord or telegram or something like that, that would be amazing too. You could help much more people

  • @DaveGrayTeachesCode

    @DaveGrayTeachesCode

    2 жыл бұрын

    Thank you, Tabarna! 🙏 You can use other languages to build your frontend along with HTML & CSS such as PHP.. but you may still find that you need some JavaScript. JavaScript runs in the browser while PHP will render from the server. I recently opened my Discord, too! Here is the link: discord.gg/neKghyefqh

  • @abdomahmoud8769
    @abdomahmoud87692 жыл бұрын

    Hi Dave! can you explain this meta tag because you didn't cover it in your html course

  • @DaveGrayTeachesCode

    @DaveGrayTeachesCode

    2 жыл бұрын

    Good question! It really isn't necessary these days, but the Emmet Abbreviation to create a page skeleton still puts it in there. A good explanation here: stackoverflow.com/questions/6771258/what-does-meta-http-equiv-x-ua-compatible-content-ie-edge-do

  • @g2jnan427
    @g2jnan427 Жыл бұрын

    Sweet baby Jesus! I could not, for the life of me, figure out how to center my grid items. Thank you!!

  • @DaveGrayTeachesCode

    @DaveGrayTeachesCode

    Жыл бұрын

    Glad I could help!

  • @Web-Himansu
    @Web-Himansu Жыл бұрын

    Sir how to learn advanced html,css and javascript. Can I learn these from MDN or any other resources

  • @DaveGrayTeachesCode

    @DaveGrayTeachesCode

    Жыл бұрын

    MDN is a great resource. The first link in the description is to my Web Dev Roadmap guide. It steps you through what to study from beginning to full stack. I also have an Advanced JS playlist on my channel.

  • @mischief9499
    @mischief94997 ай бұрын

    Sir can you tell the difference between width: 100vw and min-width: 100vw? I tried to write code to achieve a visual difference between these two but I end up producing the same result. Can you tell me what should I try to achieve a difference in these two so i can learn

  • @DaveGrayTeachesCode

    @DaveGrayTeachesCode

    7 ай бұрын

    min-width: 100vw will allow a width _larger_ than 100vw. width: 100vw will not.

  • @mischief9499

    @mischief9499

    7 ай бұрын

    @@DaveGrayTeachesCode ok

  • @dharmeshgohil9375
    @dharmeshgohil93752 жыл бұрын

    Like it most

  • @DaveGrayTeachesCode

    @DaveGrayTeachesCode

    2 жыл бұрын

    Thank you, Dharmesh! 💯

  • @umutpiynar9309
    @umutpiynar9309 Жыл бұрын

    Only part I didn't understand was using min-width instead of max-width. Like if the max-width is smaller than 578 we should destroy the navbar since it's a small screen but you did the complete opposite idk why.

  • @DaveGrayTeachesCode

    @DaveGrayTeachesCode

    Жыл бұрын

    I find responsive design is easier when starting with the smallest screen and working your way up - expanding - instead of working your way down and trying to squeeze things in.

  • @umutpiynar9309

    @umutpiynar9309

    Жыл бұрын

    @@DaveGrayTeachesCode Makes sense, thanks for answering.