Add even space between div tags using flexbox with no outside margins

This lesson is exclusive to members

Course contents
SECTION: 4
Project 2: Bike Repair Website 6:12:48
SECTION: 6
Project 4: Bootstrap Yogurt Website 3:35:39

Questions

You need to be a member to view comments.

Join today. Cancel any time.

Sign Up

Course info

128 lessons / 17 hours 5 projects Certificate of achievement

Overview

Hi there, my name is Daniel Scott and together we’re going to learn how to build professional responsive websites. which look good on mobiles, tablets and desktop screens.

We will build 4 sites together...
  • a simple but elegant restaurant website.
  • a bike repair website. 
  • a responsive portfolio website.
  • a Bootstrap website.  

We cover everything you need to build your first website. From creating your first page through to uploading your website to the internet. We’ll use the world’s most popular (and free) web design tool called Visual Studio Code.

There are exercise files you can download and then work along with me. At the end of each video I have a downloadable version of where we are in the process so that you can compare your project with mine. This will enable you to see easily where you might have a problem.

We will delve into all the good stuff such as how to create your very own mobile burger menu from scratch learning some basic JavaScript and jQuery. 

 You will...
  • Learn how to work with responsive images and icons. and stunning full screen background images and probably one too many gradients. 
  • Learn how to create forms and to choose great fonts for your website. 
  • Learn how to work with Bootstrap 4 to easily add carousels, cards and complex looking menus. 
  • Setup a domain name with hosting so that your website is live on the internet for others to see.  

There are fun class projects for you to work on which will enable you to practice what you learn. By the end of this course you’ll have a great understanding of important web design topics like HTML5, CSS3, Flex box, Responsive design and Bootstrap.   

If that all sounds a little too fancy - don’t worry, this course is aimed at people new to web design and who have never coded before. We’ll start right at the beginning and work our way through step by step. 

Who am I? 

I’m Dan, and I’ve been building websites for about 15 years now. I am award winning instructor, and have won a MAX Master award for the last 2 years in a row at the prestigious Adobe Max conference.

Time to upgrade yourself?
Sign up for the course and let’s learn how to build responsive websites.

Course duration 16 hours 42 mins
Daniel Scott

Daniel Scott

Founder of Bring Your Own Laptop & Chief Instructor

instructor

I discovered the world of design as an art student when I stumbled upon a lab full of green & blue iMac G3’s. My initial curiosity around using the computer to create ‘art’ developed into a full-blown passion, eventually leading me to become a digital designer and founder of Bring Your Own Laptop.

Sharing and teaching are a huge part of who I am. As a certified Adobe instructor, I've had the honor of winning multiple Adobe teaching awards at their annual MAX conference. I see Bring Your Own Laptop as the supportive community I wished for when I was first starting out and intimidated by design. Through teaching, I hope to bring others along for the ride and empower my students to bring their stories, labors of love, and art into the world.
True to my Kiwi roots, I've lived in many places, and currently, I reside in Ireland with my wife and kids.

Certificates

We’re awarding certificates for this course!

Check out the How to earn your certificate video for instructions on how to earn yours and click the available certificate levels below for more information.

Downloads & Exercise files

Download Exercise Files Download Completed Files

Transcript

All right, you're back, I'm back. This video, we're going to talk about spacing, in between our little boxes down here. Super easy, using Flexbox. The cheat is, just add that, and you're all right to the parent, but let's talk about it a little bit more in the video, so that we would really understand it, plus hang around, there's a shortcut sheet at the end. All right, see you in a sec. 

You might have seen this in the last video, but before we can get started we need to fix a little syntax problem. You might have noticed, I forgot to put these, the semicolons at the end. And why didn't it break it? Still working fine. It's because it's the last thing in this list. I said background, it needs the semicolon to know that's finished. Then the same with minimum height, needs to know it. Then this, one to get started, but there's nothing after it so it's fine. It's not until you go, "All right I want to do something with the… I don't know, display, but it just doesn't work. It's the wrong color, and doesn't pre-fill in. It's because I forgot these fellas. That's fine, got that out of the way. 

So what we want to do is we want to add some spacing. I'll show you the bad way and then the really easy way, because we could just go through-- we need to make the boxes a little bit smaller, because there's no room at the moment for spacing. So we could just go in here now, and say, actually let's make this-- let's just make it 30% for all of these. Now I'm going to use my multi cursor; have I done multi cursor yet? I think I have, I did, anyway, if we haven't, you can hold down the, on a Mac it's the Option key, on a PC it's the Alt key, and you can click once, twice, three times. See my cursor is flashing on all of them, I think we did it a slightly different way. 

If you are not sure of the shortcut, or it's not working for you, it's this one here, it is, there it is, there. You can switch between Command click for a multi cursor, or there's another option, which is Alt click. You can toggle between those two, just work out which one works for you. Then we'll go to your handy-dandy shortcut PDF that we gave you, remember that? Let's type in '30', nice, 'Save All', preview. Now we've got some space, it's all over here, so we want to put it in between, and we could do this, we could go 'Margin', so the first one's going to have a bit of margin on the right, and it's so we want it to be 20 pixels, awesome. So that's there, and in this one I want 20 pixels on the right of this one as well. Come here, you, you. Awesome, and then on this one, you're like, "Ah, it's too much", so it's increased this one up a little bit, we get it to the edge and you end up--

Tthe biggest problem is we're mixing percentages with physical sizes. So the real easy thing to do is delete this, and another one of the perks of Flexbox, we've been learning lots of perks of Flexbox, get rid of-- we need the widths. All we need to do to the parent is say, actually I'd like you to, justify, justify content, and I want it to be-- there's lots of different ones, we're going to use space. Now there's two that you'll use, space around, and between. I'm going to do-- let's do around, I'm going to put in a semicolon. So all the children are going to space out nicely, let's have a little look. Cool. 

So it's put space either side. So there's this, they both have equal amounts either side, they kind of double up in the middle, because he's being-- they're both kind of connecting together. The other way you can do it is the other one, so we did space around , and the other one is called space between. Save it, and that's the one I want, I think, there you go. So it just separates them out nicely. Thanks, Flexbox. And if you're like, "Oh, there's Flexbox stuff", I'm never going to remember that as well because I do that, I'm like, "Is it Justify Content?" There's another one called Justify Items, I think, anyway. 

What I've done is I've given you, in your Exercise Files, in your Shortcuts Sheet, this thing called Flexbox Sheet by Joni Trythall. That will do. This is really cool, really pretty as well, good work. It's quite long, you might want to print it off. You might want to just look at it like this, and it just gives me kind of some basic understanding of them. You can see here, to activate the powers of Flexbox, the container needs to have Display Flex on it, and then the children, let's say this one here. The one we wanted was, what did we do? We did, Justify content space around. Space between. Go right to the edges, so it's got nice little visuals of it, which I find super useful, you can just go through and just kind of--

We're going to cover lots more of this in the course, but we'll refer back to this one, thanks for this, Joni. All right, that's it for this one, we've done our spacing. Let's get into the next video.
  • Powered by Marvin
  • Terms of use
  • Privacy policy
  • © Bring your Own Laptop Ltd 2024