CSS Media Queries Tutorial for Responsive Design

แชร์
ฝัง
  • เผยแพร่เมื่อ 10 ก.ย. 2024

ความคิดเห็น • 163

  • @AdrianTwarog
    @AdrianTwarog  4 ปีที่แล้ว +46

    I am trying to grow my channel, so support and #subscriptions very much appreciated :) Thanks for watching and hope you liked and learnt something new!

    • @sivuyilemene8738
      @sivuyilemene8738 4 ปีที่แล้ว +1

      Can you make that file available to download

    • @objective5990
      @objective5990 3 ปีที่แล้ว

      Your editor pls ?

    • @NNNedlog
      @NNNedlog 3 ปีที่แล้ว

      Sure!

    • @phamngocquang2126
      @phamngocquang2126 2 ปีที่แล้ว

      wow thanks for great video. Can you share the source code in this video?

    • @athaliaorg
      @athaliaorg 2 ปีที่แล้ว

      Hi, what editor are you using?

  • @mariakononevskaya7796
    @mariakononevskaya7796 3 ปีที่แล้ว +14

    it is a very nice video with good explanations, the only thing I would wish for is to have your html and css in the description to follow along.

  • @blueb06
    @blueb06 3 ปีที่แล้ว +1

    All I can say is Thank you.....from the bottom of my heart...as I'm in the middle of the biggest suffering of making my website responsive...!

  • @MrViciousway
    @MrViciousway 3 ปีที่แล้ว +4

    Blown a way, buddy declared variables in CSS 🙌🏼 second time I see anyone do that and I've completely forgotten about it. Great explanation of media queries.

  • @0GULSHAN
    @0GULSHAN 2 ปีที่แล้ว +1

    I'm a backend dev with good experience but for my current job I have to create frontend too and Adrian your videos helped me a-lot, thank you for your tutorials.

  • @SecretEyeSpot
    @SecretEyeSpot 3 ปีที่แล้ว +5

    My only questions are:
    1) how do we define what the screen size is already to then apply the style rules we would want via our property requirements? ( I'm aware of using inspect, but when we've began designing for desktop/laptop view with our fixed with and height requirements how do we know what their true value is?)
    2) what are the roles min and max width play in relation to the original screen size to then apply them in media queries?
    Thank you so much for explaining this clearly

    • @a_green_cat
      @a_green_cat 2 ปีที่แล้ว

      Hey, I’m also quite new to web development but I generally like using my browser’s mobile emulator (I use Edge, but most common browsers should have one). It also allows you to set custom screen sizes.

    • @SecretEyeSpot
      @SecretEyeSpot 2 ปีที่แล้ว

      @@a_green_cat I'm so happy I learned this a year later. However I still struggle with understanding page constraints box model wise. Are you on discord?

  • @reemalnaji3718
    @reemalnaji3718 3 ปีที่แล้ว +3

    Thank you sooo much I was looking for this type of videos to help me finish my website. I am new to coding trying to learn media queries and your video gives me the answer. you gained alike and a subscriber

  • @tajinderjsingh826
    @tajinderjsingh826 4 ปีที่แล้ว +6

    Thanks, Adrian. it's one of the best videos with an effective demonstration.

  • @NNNedlog
    @NNNedlog 3 ปีที่แล้ว

    Thanks a lot for this. This has saved me life. I am currently working on a school project and need my website to be responsive for mobile. Thanks Adrian

  • @sabuein
    @sabuein 2 ปีที่แล้ว

    I think this is the best CSS tutorial I've ever seen, thank you, Adrian, so much.

  • @ianhnizdo4787
    @ianhnizdo4787 2 ปีที่แล้ว

    Oh man I have so much to learn. Its exciting and intimidating at the same time lol.

  • @medusa121
    @medusa121 3 ปีที่แล้ว +4

    Crystal clear and straight forward. Thank you!

  • @techwake360
    @techwake360 4 ปีที่แล้ว +1

    your teaching skill is best. you teaching us with easiest way

  • @joedzpadin6501
    @joedzpadin6501 4 ปีที่แล้ว +2

    I've been looking answers for my questions regarding media query. You video answered it all. Thank you.

  • @sheikhanas8113
    @sheikhanas8113 ปีที่แล้ว

    One of the best explained about responsive website thnq very much sir for clear my doubt

  • @aloksharma5468
    @aloksharma5468 ปีที่แล้ว

    I've made a music application which works perfectly fine on desktop but when I shrink the screen size to around 600px, everything got messed up. Thanks for your tutorial Adrian. You have earned one more subscriber!!

  • @jaydenmoon1165
    @jaydenmoon1165 2 ปีที่แล้ว +1

    This was an amazing tutorial on media queries - straight to the point and very well done - subbed and cannot wait to see more

  • @Pankaj-Verma-
    @Pankaj-Verma- 3 ปีที่แล้ว +2

    Short and concise.
    Thank you for your kind help.

  • @chromesavior
    @chromesavior 2 ปีที่แล้ว

    AMAZING thanks for youtube for showing this besttt tutorial using @media

  • @shrikantjha5630
    @shrikantjha5630 4 ปีที่แล้ว +4

    That's cool very much interactive and smooth.

  • @chideraachinike7619
    @chideraachinike7619 3 ปีที่แล้ว +3

    Thank you for making me a little smarter today ❤️

  • @DavisTibbz
    @DavisTibbz 2 ปีที่แล้ว +1

    Just learned about $ variable in CSS today.

  • @naitikkathiriya
    @naitikkathiriya 3 ปีที่แล้ว +1

    thank u so much adrian dude, really helped for coding and listen English carefully to improve😁... all was very good!!

  • @alihakimoglu1189
    @alihakimoglu1189 3 ปีที่แล้ว +1

    Thank you, sir. With the help of you, I could finally understand the concept.

  • @layerseven8755
    @layerseven8755 ปีที่แล้ว

    How are you viewing changes to your web browser in real time? The CSS previewer in VS isn't working for me, when I run my code it doesn't show real time changes, requires a refresh.

  • @victor7ultimate
    @victor7ultimate 2 ปีที่แล้ว

    Thanks for the detailed tutorial.
    You've got my like and subscribtion already.

  • @min0234
    @min0234 2 ปีที่แล้ว +1

    Really appreciate this video! Thank you!

  • @Teknisindesoo
    @Teknisindesoo 2 ปีที่แล้ว +1

    Good jobs MASTER ANDRIAN

  • @code_magpie
    @code_magpie 2 ปีที่แล้ว

    This was a great and simple one. Thanks! And also let's subscribe.

  • @johnhayes2947
    @johnhayes2947 2 ปีที่แล้ว

    if I put $desktop:1200px; to assign px in my CSS, it comes up as an error. "identifier expected". Why is this?

  • @nurudeenmohammedhuloty6554
    @nurudeenmohammedhuloty6554 11 หลายเดือนก่อน

    Thank you Adrian. My breakpoint declaration is not working, I declared my breakpoints in my root selector and it’s not working at all. Please help me out. Appreciated.

  • @guylaineregimbald2914
    @guylaineregimbald2914 3 ปีที่แล้ว

    This is great info for a designer working with developers. Thanks

  • @tunde6159
    @tunde6159 3 ปีที่แล้ว

    This has helped me immensely. Thank you Adrian.

  • @346ask
    @346ask 3 ปีที่แล้ว +2

    Amazing video, thanks Adrian.

  • @aghileslounis
    @aghileslounis 3 ปีที่แล้ว +1

    Excellent, but why a desktop size is 1200px? i don't understand because my laptop has 1366px and all my desktop monitors have minimum 1920px width

  • @jemilaabdulkadir4208
    @jemilaabdulkadir4208 ปีที่แล้ว

    I am a bit confused with the split screens. The definition of the screen sizes e.g $desktop... where do they go? must they be on a separate css file? or does this work with internal styling?

  • @hh202g
    @hh202g 2 ปีที่แล้ว

    thanks you you solved it for me bro
    god bless you🌷

  • @elias-soykat
    @elias-soykat 3 ปีที่แล้ว

    how check your layout or tags preview without hovering css selector from browser devtools.. how could you from code editor that. when you typing show a blue preview shadow outside of tags or layout. is it an extention or built in features?

  • @wakwawunited1588
    @wakwawunited1588 2 ปีที่แล้ว +1

    I have question..
    Why u can write css with pseudocode ? This scss ?.
    Bcs i trying css using pseudocode error.
    Pseudocode :
    .title{
    .sub-title{
    }
    }

    • @AdrianTwarog
      @AdrianTwarog  2 ปีที่แล้ว

      Good point, luckily scss is being built into chrome and browsers these days!

  • @sabuein
    @sabuein 2 ปีที่แล้ว

    Thank you, Adrian.

  • @gabrielmoraes4516
    @gabrielmoraes4516 ปีที่แล้ว

    Great video! thank you!

  • @hollyhenske1806
    @hollyhenske1806 2 ปีที่แล้ว

    my css files won't accept $desktop or anything after the "$" (css identifier expected) Anybody know an easy way around this?

  • @tenzinpesangdompatsang369
    @tenzinpesangdompatsang369 3 ปีที่แล้ว

    Very clear explanation, thank you

  • @yeruvasatishreddy3675
    @yeruvasatishreddy3675 2 ปีที่แล้ว

    Thank you very much sir
    For your tutorial

  • @jasonwingo816
    @jasonwingo816 2 ปีที่แล้ว

    What a great video you explained this topic awesome thanks Adrian!!

  • @jamesrandes8473
    @jamesrandes8473 2 ปีที่แล้ว +1

    Why my media query nesting on body selector not working like yours? plss answer me

    • @AdrianTwarog
      @AdrianTwarog  2 ปีที่แล้ว

      I’m running Scss that might be the reason

  • @samanthapayasean1013
    @samanthapayasean1013 4 ปีที่แล้ว +2

    When I do
    $desktop:1200px;
    $laptop: 992px;
    $tablet:768px;
    $phone:480px;
    My css file shows error stated that unexpected token '$' and Expected a 'FUNCTION' or 'IDENT' after colon.
    What can I do to fix it?
    Thanks!

    • @AdrianTwarog
      @AdrianTwarog  4 ปีที่แล้ว +2

      Samantha I am using SASS so make sure you have a compiler to change it into CsS

    • @samanthapayasean1013
      @samanthapayasean1013 4 ปีที่แล้ว

      @@AdrianTwarog got it! thank you

  • @porkrollontoast8870
    @porkrollontoast8870 2 ปีที่แล้ว +1

    So I have the same features on a webpage but when I enlarge window (bigger then half page screen) it disappears pretty css and shows only html

    • @AdrianTwarog
      @AdrianTwarog  2 ปีที่แล้ว

      Same css?

    • @porkrollontoast8870
      @porkrollontoast8870 2 ปีที่แล้ว

      @@AdrianTwarog yes I found the problem good nights sleep pointed out super silly one too I had the css going without a end bracket in a section it got misplaced to bottom

  • @bilawal-7930
    @bilawal-7930 2 ปีที่แล้ว

    Hi Sir ..I want to Learn Responsiveness But I have watch So many videos unfortunately I did not got any concept When I watched Your this video then As soon as my interest enhance Because of you ..But Please Sir guide me How to learn more and more ..You are my spiritual Teacher .. Please Sir this is not a such comment ..when I not learn any thing then I go in depression mode then my blood pressure shoot after

  • @ongpytran4552
    @ongpytran4552 4 ปีที่แล้ว +1

    Thank you so much! I learned a lot

  • @workoutwell7435
    @workoutwell7435 3 ปีที่แล้ว

    Thank you!!!! My code is now responsive!!!!

  • @martindurrant5505
    @martindurrant5505 4 ปีที่แล้ว +10

    great video, i particularly liked the way you organised your CSS code, i'll be using that going forward. one question though, you use PX for everything, but a lot of advise is to use EM or REM, What is the correct or best practise, when organising fonts and elements? thanks

    • @vishalpawar1366
      @vishalpawar1366 2 ปีที่แล้ว

      Nothing is best, as per conditions u have to use it. % use for Resposiveness and rem for root element size as compare to parents

  • @noreakunnong6670
    @noreakunnong6670 3 ปีที่แล้ว +1

    Very clear about explain thank you so much.

  • @mwizachiwale8024
    @mwizachiwale8024 2 ปีที่แล้ว

    Clear and simple 🙌🙌

  • @rancellarongannaban4625
    @rancellarongannaban4625 3 ปีที่แล้ว

    wow. it helps me a lot! thank you so much. u so good at explaining

  • @fivemozzygaming
    @fivemozzygaming 2 ปีที่แล้ว

    Coming in clutch

  • @Munchkie
    @Munchkie 3 ปีที่แล้ว

    Very concise! Thank you

  • @rangamadinesh5725
    @rangamadinesh5725 ปีที่แล้ว

    it's really helps.....keep going
    👍

  • @mrshawnspencer
    @mrshawnspencer 3 ปีที่แล้ว +1

    Great stuff, and, yes, you have a new subscriber.

  • @codedynamics1
    @codedynamics1 3 ปีที่แล้ว

    Ok cool but what do you do if IT DOESNT WORK. Ive been stuck for 2 days now on a simple project i have built and just need the media queries to work so that i can move on. Use to use it all the time but have been doing node stuff recently now i completed this project and nothing i do is making it work. I followed your simple code in the body @media and tried to change my background to red ...nothing soo frustrating i cant figure out why its not working. Everything im doing is front end apart from my AJAX request which is also fron end but its getting data from an external server which has nothing to so with it

  • @skeleton-bullfrog
    @skeleton-bullfrog 2 ปีที่แล้ว

    I know this is late but can anyone tell me how he has the web page window on the size of the screen and it doesn't automatically close out? Thank you

  • @rizsurya2661
    @rizsurya2661 ปีที่แล้ว

    how you highlight the elemen in browser while you edit the code on text editor ?

  • @uglyinagoodway4112
    @uglyinagoodway4112 3 ปีที่แล้ว +1

    Hi! that auto refresh is fun! and it saves so much time. I wish I knew how to have this!

  • @lashachan
    @lashachan 3 ปีที่แล้ว

    My website looks great for 1920x1080 but the design breaks on 2560x1440. Is there a way to fix that with media query or any other way?

  • @user-gd5yj6lr9t
    @user-gd5yj6lr9t 3 ปีที่แล้ว

    Thank you so much, but I have a question please.
    How to insert the same width, size at the ends of the screen (left and right) as on your video, so that when the screen is enlarged the size of the ends does not change ?
    Thank you.

  • @manuelpineda9067
    @manuelpineda9067 2 ปีที่แล้ว

    Very good video, really informative!

  • @lfaloumlil7175
    @lfaloumlil7175 3 ปีที่แล้ว +1

    good explanation bro👍👍👍👍👍👍👍

  • @iamdanyaal
    @iamdanyaal 3 ปีที่แล้ว

    Thank You Sir

  • @ramalsrougi
    @ramalsrougi 3 ปีที่แล้ว

    Thank you so much.. that was very helpful 😍❤❤❤

  • @zwierze
    @zwierze 3 ปีที่แล้ว

    so as far as I understand this isn't an automatic process but you need to basically design from the beginning for different screen sizes? Like checking in your browser or any responsivenator how does it look like and then apply the changes needed? Is there any way to check those breakpoints? I struggle with pixels. How should I know how many pixels a given screen has?

  • @secretshoresofgoa
    @secretshoresofgoa 3 ปีที่แล้ว

    Thanks. Great video

  • @asbelfernandez3081
    @asbelfernandez3081 3 ปีที่แล้ว +1

    Very nice tutorial great skills!

  • @harrisonnjenga777
    @harrisonnjenga777 3 ปีที่แล้ว +1

    Thanks alot this was helpful

  • @Mrkafirr
    @Mrkafirr 3 ปีที่แล้ว

    That was helpful 😌

  • @gbsbill
    @gbsbill ปีที่แล้ว

    Nice Adrian: my question is what is that awesome program you are typing in. I can see that would really help me.

  • @amazighshawiagirl7416
    @amazighshawiagirl7416 3 ปีที่แล้ว

    Thanks a lot

  • @mackensonreginaldmichel399
    @mackensonreginaldmichel399 3 ปีที่แล้ว

    Very good friend. I'd like you to tell about units and responsiveness. Thanks a bunch

  • @davidtesno1721
    @davidtesno1721 3 ปีที่แล้ว +2

    Thanks for the video, I like the variable setup don’t know you can do that. Why not create a separate sheet for queries, like a media-query.css and separate concerns would make it easier to read/follow.

  • @JustKenny1
    @JustKenny1 3 ปีที่แล้ว +1

    What about 1080p phones?
    How do I media query that?
    Pc is 1080p and my phone is 1080p. I can not do minmax properties.

    • @AdrianTwarog
      @AdrianTwarog  3 ปีที่แล้ว

      How do you mean? If their 1080 then they can display everything right?

    • @JustKenny1
      @JustKenny1 3 ปีที่แล้ว +1

      @@AdrianTwarog wow. Thx for replying! I meant, if I do
      @media (max-width:550px) {
      Background-color: red;
      }
      For example. I want background to be red on my phone. But my phone has 1080x1920px screen. How will max-width work with that? Sorry for bad English. Love you so much from Kazakhstan)

    • @HamzaMohamed-xj9tz
      @HamzaMohamed-xj9tz 3 ปีที่แล้ว

      @@JustKenny1 yo kenny. i literally have to upload my we development in 3 days so im literally asking random people for help at this point. But ive literally done the exact same media query as the guy who made this youtube video but theres literally no changes being made on my website. (btw ye i did add the meta name="viewport" etc etc at the top of my html file. if you could help me out with this bro your a legend

  • @fannyfranzen7561
    @fannyfranzen7561 2 ปีที่แล้ว

    Thanks

  • @-HarishkumarG
    @-HarishkumarG 2 ปีที่แล้ว

    So according to the device size each time we have to specify media queries right?

  • @thecoderraj3777
    @thecoderraj3777 3 ปีที่แล้ว

    Thanks a lot sir 🙏😊🙏

  • @asifhossain2088
    @asifhossain2088 3 ปีที่แล้ว

    nice one, love it

  • @safa9963
    @safa9963 3 ปีที่แล้ว

    thank you :)

  • @ArtByArja
    @ArtByArja 4 ปีที่แล้ว

    im using dreamweaver....and its a struggle because the split doesnt update itself..:(

  • @stealthbusiness
    @stealthbusiness 2 ปีที่แล้ว

    Thank you for all your tutorials. So helpful. I am in learning mode, so I hoping you would be willing to let us know the following. I believe this is a Media Query question. I have 4 different full screen videos one for each breakpoint. How do add each one to the assigned breakpoint?

  • @rajasekhar5135
    @rajasekhar5135 3 ปีที่แล้ว

    I will support u bro

  • @lambo-ca
    @lambo-ca 3 ปีที่แล้ว

    This is the hardest part for me in making a website.

  • @TimurCatakli
    @TimurCatakli 3 ปีที่แล้ว +1

    Hey Adrian, thanks a lot for the video. But when I use the @media inside BODY, there is no effect but if I move them outside BODY and create multiple BODY it works. How come your version is working?

    • @AdrianTwarog
      @AdrianTwarog  3 ปีที่แล้ว

      Heaps of reasons it might or might not work, hard to say without seeing code, hopefully my example shows syntax of it working that can help?

    • @TimurCatakli
      @TimurCatakli 3 ปีที่แล้ว +1

      @@AdrianTwarog I think I know why, you are using .scss and it is fixing that issue for you. Could it be that?

    • @AdrianTwarog
      @AdrianTwarog  3 ปีที่แล้ว

      @@TimurCatakli very likely, I have a compiler in the background converting it, otherwise regular css has to be used

  • @eustatskid
    @eustatskid 3 ปีที่แล้ว +2

    Thanks. always big help hope you have a community group fb tg discord or any. where we can talk or ask or brainstorming to other people :D

  • @HamzaMohamed-xj9tz
    @HamzaMohamed-xj9tz 3 ปีที่แล้ว +1

    bro im gonna shoot in the dark here and pray to god you see this but. (I've subbed btw and watched your other videos xD) Right so i'm literally trying to do some media query and it does not work. I wrote the exact same thing as you. Also added at the top of my html file content="width-device, intial-scale=1"> So why is the media query making no difference? If anyone can answer this. I'll be grateful

  • @viniciusm.m.7822
    @viniciusm.m.7822 2 ปีที่แล้ว

    Nice!!!

  • @Mercenarys
    @Mercenarys 3 ปีที่แล้ว

    Wondering if sass makes a difference than Css to combine it with media inside a class tag 🤔

  • @donatellodonini3147
    @donatellodonini3147 3 ปีที่แล้ว

    Why do you changed the background colour?

  • @LuisReyes-zs4uk
    @LuisReyes-zs4uk 3 ปีที่แล้ว

    I love your videos! Perfect for a beginner like myself who is trying to see how the pros do things. Just one part I was confused about: At 10:30, why was "min-height" used? (I was expecting "height" to be used). Thanks!

  • @AmritBhandari
    @AmritBhandari 2 ปีที่แล้ว

    best video

  • @javadmh7827
    @javadmh7827 3 ปีที่แล้ว

    very helpful

  • @shishirislam780
    @shishirislam780 2 ปีที่แล้ว

    Nice video

  • @objective5990
    @objective5990 3 ปีที่แล้ว

    What's the editor ? Pls

  • @dollygkmr
    @dollygkmr 4 ปีที่แล้ว +1

    Whats is the Ide used here? I usually work with notepad++

    • @towednack4723
      @towednack4723 3 ปีที่แล้ว

      You can see it in the video! He used Brackets