This is Sasha and welcome to another CSS training video where I share with you how to modify and manipulate your business website. In today’s video, what I’d like to do is discuss the CSS property of overflow. Let’s take a quick peek.
The overflow property is convenient when certain elements collapse, and sometimes it happens unexpectedly. When in doubt and when you’re div looks small and tiny due for whatever reason, sometimes the overflow can help you.
In either case, looking at this background, here are some default text that I have that’s some paragraph things. If I define a height of let’s say 350 pixels right here, you can see the actual text itself doesn’t compress to 350 pixels because as you continue to scroll down, all of that remains to overflow and go beyond it. That’s why sometimes this happens is because of that issue when you have some div elements.
--------------------- HTML CODE ------------------
What I’ve done is I’ve actually created a physical journal, it’s
called my traging journal and if you want to take a look
What I’ve done is I’ve actually created a physical journal, it’s
called my traging journal and if you want to take a look
What I’ve done is I’ve actually created a physical journal, it’s
called my traging journal and if you want to take a look
What I’ve done is I’ve actually created a physical journal, it’s
called my traging journal and if you want to take a look
What I’ve done is I’ve actually created a physical journal, it’s
called my traging journal and if you want to take a look
What I’ve done is I’ve actually created a physical journal, it’s
called my traging journal and if you want to take a look
What I’ve done is I’ve actually created a physical journal, it’s
called my traging journal and if you want to take a look
What I’ve done is I’ve actually created a physical journal, it’s
called my traging journal and if you want to take a look
What I’ve done is I’ve actually created a physical journal, it’s
called my traging journal and if you want to take a look
--------------------- CSS CODE ------------------
.leftcol {
background: #5dc17b;
height: 350px;
}

The overflow property
I’m not saying that it even happens with the height. Sometimes it just happens by the alignment of the elements like floating and so on. But in either case if you get something like this that doesn’t work out, sometimes one of the approaches is to type in overflow and then you do auto and that usually will fix it.
--------------------- HTML CODE ------------------
What I’ve done is I’ve actually created a physical journal, it’s
called my traging journal and if you want to take a look
What I’ve done is I’ve actually created a physical journal, it’s
called my traging journal and if you want to take a look
What I’ve done is I’ve actually created a physical journal, it’s
called my traging journal and if you want to take a look
What I’ve done is I’ve actually created a physical journal, it’s
called my traging journal and if you want to take a look
What I’ve done is I’ve actually created a physical journal, it’s
called my traging journal and if you want to take a look
What I’ve done is I’ve actually created a physical journal, it’s
called my traging journal and if you want to take a look
What I’ve done is I’ve actually created a physical journal, it’s
called my traging journal and if you want to take a look
What I’ve done is I’ve actually created a physical journal, it’s
called my traging journal and if you want to take a look
What I’ve done is I’ve actually created a physical journal, it’s
called my traging journal and if you want to take a look
--------------------- CSS CODE ------------------
.leftcol {
background: #5dc17b;
height: 350px;
overflow: auto;
}

Now in our case, since we’ve defined a height, it won’t fix it but keep that in mind in the future because that’s a major glitch that some people run across. When I do auto, you can see it actually added a scrollbar there which in theory if you go ahead and do overflow scroll that is what the scrollbar part does.
--------------------- HTML CODE ------------------
What I’ve done is I’ve actually created a physical journal, it’s
called my traging journal and if you want to take a look
What I’ve done is I’ve actually created a physical journal, it’s
called my traging journal and if you want to take a look
What I’ve done is I’ve actually created a physical journal, it’s
called my traging journal and if you want to take a look
What I’ve done is I’ve actually created a physical journal, it’s
called my traging journal and if you want to take a look
What I’ve done is I’ve actually created a physical journal, it’s
called my traging journal and if you want to take a look
What I’ve done is I’ve actually created a physical journal, it’s
called my traging journal and if you want to take a look
What I’ve done is I’ve actually created a physical journal, it’s
called my traging journal and if you want to take a look
What I’ve done is I’ve actually created a physical journal, it’s
called my traging journal and if you want to take a look
What I’ve done is I’ve actually created a physical journal, it’s
called my traging journal and if you want to take a look
--------------------- CSS CODE ------------------
.leftcol {
background: #5dc17b;
height: 350px;
overflow: scroll;
}

The other thing that you could do is type in hidden which means it’ll hide anything after the 350 pixels and that is it. It’ll give you the 350 pixels and that’s it. It’ll be hidden. But ultimately what you want to do and remind yourself is you have that auto option as well, you have the scroll that’s kind of another common one or you have the hidden.
--------------------- HTML CODE ------------------
What I’ve done is I’ve actually created a physical journal, it’s
called my traging journal and if you want to take a look
What I’ve done is I’ve actually created a physical journal, it’s
called my traging journal and if you want to take a look
What I’ve done is I’ve actually created a physical journal, it’s
called my traging journal and if you want to take a look
What I’ve done is I’ve actually created a physical journal, it’s
called my traging journal and if you want to take a look
What I’ve done is I’ve actually created a physical journal, it’s
called my traging journal and if you want to take a look
What I’ve done is I’ve actually created a physical journal, it’s
called my traging journal and if you want to take a look
What I’ve done is I’ve actually created a physical journal, it’s
called my traging journal and if you want to take a look
What I’ve done is I’ve actually created a physical journal, it’s
called my traging journal and if you want to take a look
What I’ve done is I’ve actually created a physical journal, it’s
called my traging journal and if you want to take a look
--------------------- CSS CODE ------------------
.leftcol {
background: #5dc17b;
height: 350px;
overflow: hidden;
}

This is sometimes a lifesaver when you have floating elements that are not working out properly or something in a major layout with a lot of divs is not aligning properly or something isn’t showing up, this is one of the ways that you can go ahead and fix it by doing overflow auto and I can’t really replicate that issue right now because I don’t have a ton of divs and it’s not causing a lot of conflict.
Keep that in the back of your mind as you continue to look at your page and look at your business website. Of course, as you take a look at your own page and if you don’t put in the overflow, you can see what it’s going to do. It’s going to continue with that text and sometimes have problems for your page, for your alignment, the way things are done.
--------------------- HTML CODE ------------------
What I’ve done is I’ve actually created a physical journal, it’s
called my traging journal and if you want to take a look
What I’ve done is I’ve actually created a physical journal, it’s
called my traging journal and if you want to take a look
What I’ve done is I’ve actually created a physical journal, it’s
called my traging journal and if you want to take a look
What I’ve done is I’ve actually created a physical journal, it’s
called my traging journal and if you want to take a look
What I’ve done is I’ve actually created a physical journal, it’s
called my traging journal and if you want to take a look
What I’ve done is I’ve actually created a physical journal, it’s
called my traging journal and if you want to take a look
What I’ve done is I’ve actually created a physical journal, it’s
called my traging journal and if you want to take a look
What I’ve done is I’ve actually created a physical journal, it’s
called my traging journal and if you want to take a look
What I’ve done is I’ve actually created a physical journal, it’s
called my traging journal and if you want to take a look
--------------------- CSS CODE ------------------
.leftcol {
border:3px solid red;
height: 350px;
}

You’ll be able to see this right here if I go ahead in that little border again just to show you. You can see that the border goes up to 350 but then that text will continue to span. As you create more divs, it could cause a problem, so again, another thing to keep in mind.