Why are my <div>s leaving their parent <div>?

This question already has an answer here:

  • Why is my div's height zero 3 answers
  • How do you keep parents of floated elements from collapsing? [duplicate] 16 answers

  • Parents will normally expand to the height of their children, though won't in case the children are floated.

  • You can remove floats to accomplish expanding.
  • In order to expand a parentdiv based on floated children try overflow: auto; on .pictureBox. This will make .pictureBox expand to the height of its children. Here's a Fiddle showing the result.
  • 链接地址: http://www.djcxy.com/p/88424.html

    上一篇: 颜色不起作用

    下一篇: 为什么我的<div>离开他们的父母<div>?