From the course: Building Responsive Forms with Flexbox
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Adding media queries - CSS Flexbox Tutorial
From the course: Building Responsive Forms with Flexbox
Adding media queries
- While we've been able to handle most of our responsive needs through Flexbox, there are still a couple of things that we need to handle through the use of media queries. For example, you'll notice as I resize the page down, when we get down to those smaller sizes, we still have that page margin for the body on either side, and our form doesn't quite fit within that space anymore, because of the size of the body element relative to those margins on either side. So, that doesn't look as great as it should, and to deal with that, we're going to use a media query. So I've opened up the forms.htm file, found in the 02-08 folder. And I'm going to go all the way down to the bottom of my styles, and just as we did in the first chapter, I'm going to add a media query. So once again, the syntax for that is @media, and then a space, and then in parentheses, I'm going to go ahead and give it a max-width of 400px. Again, that's based on the size of the form, the size of the elements inside the…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
(Locked)
Longer form structure4m 13s
-
(Locked)
Sectioning form content5m 45s
-
(Locked)
Refining basic styling7m 11s
-
Creating responsive inputs and labels7m 41s
-
(Locked)
Creating responsive checkbox groups7m 47s
-
(Locked)
Making form sections responsive5m 31s
-
(Locked)
Controlling section spacing4m 34s
-
(Locked)
Adding media queries2m 39s
-
(Locked)
-