• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 8. Space Around Boxes > The Overflow Property

The Overflow Property

What happens when an element has a certain width, but one of its children is wider? From the formula in Figure 8.17, it follows that one of the margins must be negative. Margins can indeed be negative, so formally speaking, this is a perfectly valid situation. The result is that the child will stick out of its parent, usually at the right-hand side.

But, you may not want the child to stick out. If you don’t want to change the width of the child either, a different solution has to be found. CSS offers two solutions, in addition to the default behavior:


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint