From the course: CSS: Float-Based Page Layouts (2012)

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Controlling content overflow

Controlling content overflow - CSS Tutorial

From the course: CSS: Float-Based Page Layouts (2012)

Start my 1-month free trial

Controlling content overflow

We briefly came in contact with the overflow property during the chapter on floats. In this movie I want to discuss the overflow property in a little bit more detail and how it can help us when dealing with positioned elements. To do that, I have the overflow.htm file opened up and if I look through the code of this file, after a section where we talk about the overflow property a little bit, we have this section with a class name of container and it has a lot of text in it. If I preview this in a browser, you can see that right now the text is just forming the height of the section itself, so we don't have a defined height on this section. So because of that, the height is actually being determined by the content, so there really isn't any overflow going on at all. Now this is typical for your elements. If you don't declare a specific height, for example, the contents of the element forms the height. Now I want to go right back up here for just a minute and talk about the different…

Contents