html - child 走出父元素

标签 html css

http://jsfiddle.net/zP49Z/

如您所见,子元素 [update] 超出了父元素 [feeds]。我该如何解决这个问题?

#updates {
    background: #B8C1C2;
    box-shadow: inset 0 0 5px;
    height: 100%;
    float: right;
    position: fixed;
    top: 0;
    right: 0;
    z-index: 100;
    overflow: auto;
}
#feeds {
    width: auto;
    height: 300px;
}
.update {
    border-bottom: 1px solid #929493;
    width: auto;
    height: auto;
    padding-bottom: 20px;
    margin-top: 10px;
}

谢谢!

最佳答案

你可以使用 overflow-x: hidden;如果您希望包含提要并滚动。在这里查看:jsfiddle.net/MathiasaurusRex/zP49Z/2

#feeds {
  width: auto;
  height: 300px;
  overflow-x: hidden;
}

关于html - child 走出父元素,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19886054/

相关文章:

css - 如何在容器内从右向左浮动 DIV? (不能使用绝对位置 + 右 :0)

internet-explorer-8 - ie8 和 ie9 上的 CSS 径向渐变

html - 有没有办法让 html 页脚出现在任何页面的底部?

internet-explorer - 使网站兼容IE7

html - 如何去掉标题图片中的多余空间

javascript - 如何根据是否存在另一个 CSS 类组合来更改 CSS 类?

javascript - 如何从 Adob​​e Business Catalyst 中的同一登录页面创建单独的安全区域?

javascript - 使用 Javascript 或 jQuery 在 JSON(外部本地文件)中插入/更新新记录

javascript - 如何使用此 JQueryUI 可放置代码获得正确的 div?

html - 如何使按钮均匀拉伸(stretch)以填充容器 <div>(就像带有单元格的表格行一样)