🚨 Heads up! This course is no longer supported. We recommend checking out our Webflow Essentials course.

How to add padding to a DIV

Questions

Course info

34 lessons / 3 hours

Overview

Dreamweaver (and web design in general) is such a hard program to teach yourself. We know, because as Dreamweaver trainers we have all taught ourselves. We wish we had a resource like this when we were learning.

Hand coding a website from scratch is now a thing of the past. Web designers use tools like Dreamweaver to a lot of the heavy lifting. We imagine this is your first website build and we're glad we're here to help make this process a little less troublesome. 

Who should use this?

Anyone that is brand new to Dreamweaver and anyone brand new to web design in general. If you're reasonably experienced in web design you might find this course a little slow going.

What do you need?

  • You'll need a laptop (Mac or PC)
  • Dreamweaver CC installed. Dreamweaver can be downloaded from theAdobe website here.

Can I use this tutorial with Adobe Dreamweaver CS4, CS5 or CS6?

No. Unfortunately there were some fundamental changes in the Dreamweaver CC update that makes CC and previous versions very different.

Remember you can download Dreamweaver CC free for 30 days. Don't worry - after your free trial has expired your files will still be updatable using any other web design program.

If you like the tutorials we'd love you to like, share and tweet it. We'd be very grateful.

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.

Downloads & Exercise files

Transcript

Welcome to the Stream Weaver tutorial. My name is Daniel Walter Scott and I'm a trainer here at  Bring Your Own Laptop. Now in this tutorial we're gonna look at adding some padding  to the edges of our diviv tags  because at the moment you can see  that we've got a colored background in these white  um, div tags. Now they sit to, they sit flush  with the edge there on the left  and a little bit too close to the things on the right. So what I'd like to do is add some padding just  so it sits nicer inside the div tag. So click inside the offending diviv tag.

We're gonna use the text div tag. In this case, I'm gonna down my breadcrumbs click text. Okay, so it's selected. You can see it's selected here  in my selectors panel. And I'd like to scroll down in the properties panel  until we find padding. Okay, so what I'd like to do is I'd like to add 40 pixels.

So I've just typed in 40 and hit enter. And on the left  and on the right hand side I'd like  to enter 20 and hit enter. You can see it's added the padding. You can see this kind of, uh,  if I click the div tag down here,  the frosty stuff on the left  and the frosty stuff on the right means it's 40 on  left, 20 on the right. The problem with it though is  that it's pushed its neighbor down,  which was our image div tag. It's pushed it below it because there's not enough room.

Now it's basically expanded the box by an extra 60 pixels. So what we have to do when we're adding padding,  it's a bit weird that Dreamweaver doesn't know that you want  to, um, substitute padding for the size. So it's 70, um, 700 pixels wide, plus the padding. So when we need to do is go and find the width of this box. So make sure you've selected text in the text  of tag down the breadcrumbs  and instead of it being 700, okay, I want it now to be what,  six 40 And okay,  so six 40 plus the padding equals 700. So whenever you add padding to any boxes, you may have to go  and remove it off the width.

Okay. In terms of the height, this case wouldn't matter  because we have no height set. You can see height set to auto, which means it'll expand  and contract depending on what's in the box. So if we add a padding to the top  or the bottom, it wouldn't matter. Great. Let's do it one more time.

Let's do it for the footer down here. Okay. So you can see the copyright  is sitting right next to the edge. So I'd like it to push over the exact same. I'd like to push over, uh, 40 pixels. So I'm clicking inside the footer.

I'm gonna click the diviv footer in the breadcrumbs  and I'm gonna slide down on my properties panel. And the padding here is going to be 40. Okay. And you can see it hasn't really made any difference  'cause the foot is at the end. Uh, it's our last div tag inside the container. So it's not gonna really cause us like  that many problems 'cause nothing afterwards.

But you can kind of see in the right hand side here,  it's pushed itself over 40 pixels. So let's do it properly. Let's minus the 40 pixels off this 1024. Okay. So that gets us down to  nine hundred, nine hundred and eighty four. Alright, great.

So that's how you add padding to a div tag so  that you can get things to line up. Alright, that's of the tutorial. See you in the next one.
  • Powered by Marvin
  • Terms of use
  • Privacy policy
  • © Bring your Own Laptop Ltd 2025