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.
Controlling section spacing - CSS Flexbox Tutorial
From the course: Building Responsive Forms with Flexbox
Controlling section spacing
- Controlling the spacing between flex items that are set to wrap can be a little tricky if the items are flexible rather than having a fixed width. Our sections, for example, have no space between them because each has a flex row property of one and that tells them to take up all of the remaining available space, so really they're just doing what they're being told to do. Now we need to add a little bit of space in between them that will disappear when the layout changes to a single column. Using Flexbox that's actually trickier than you might think. So to show you how this is going to work, I've got the forms.htm file open from the 02-07 directory. Now some of you have probably already thought about "Hey what if we just use a margin?" and that's exactly what we're going to do. We're going to use a margin to do this but it's a little trickier than you might think. Now Flexbox essentially ignores margins. Now what I mean by that is it allows them between elements but it ignores them…
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)
-