🚨 Heads up! This course is no longer supported. We recommend checking out our Webflow Essentials course.
How to clear the div float
Questions
Student Gallery
Be the first to share something.
Course info
Overview
- 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?
Daniel Scott
Founder of Bring Your Own Laptop & Chief 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
The problem's gonna happen. Now if I add another text box to sit underneath, it will try and slip underneath these two. So we need to do something called clearing the float to stop that happening. So let's insert a diviv tag and it's gonna be our footer. So let's insert div tag. I would like it after my image box.
This one's gonna be called footer, okay? And it ends up in the right spot. But if I give it some size, watch this. So let's style it. So main CSS let's style it. I'm gonna style the footer.
I'm gonna give it a width of 1 24 pixels, 1024. I'm gonna give it a height of pixels 200. Okay? And I'm gonna give it a background color of what do we have got red. Alright, you'll see we end up with a problem where actually what's happening is the red ones slipped underneath this, uh, these two boxes. 'cause they're floated.
And this squid is out the bottom. So what we need to do is fix that. And it's quite simple. It's called clearing the float. So whenever you floated boxes, the box directly underneath needs to be cleared. To do that, we go to our, uh, CSS, we go to a footer and we're gonna scroll down until we find, um, actually we're gonna go to layout and then scroll down until we find float like we do with the rest of them.
And under, underneath, that one's called Clear, we're gonna use this one called Clear both. I'll zoom in there for you, so find clear both. And what you'll see now is the footer kind of reappears. He slips back from underneath these guys. And there he is, there, there's our big footer. It's probably a little big, but that's all right.
Okay, so that's how you get a box to appear right after you've cleared the float. All right, I'll send you the next tutorial.