作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我在我正在构建的网站上使用 Chris Coyier 的全宽 hack,但对如何让 div 具有它包含的任何内容的高度感到困惑。
通常我会通过将 overflow:auto 添加到容器中来实现这一点,但如果我这样做,它会破坏 hack。是否有可能达到一个高度并仍然使用这个 hack?
你可以在这里看到我的问题:http://beta.revival.tv/
这是我的 CSS:
#content-wrap:before, #content-wrap:after {content: ""; position: absolute; top: 0; bottom: 0; width: 9999px;}
#content-wrap:before {right: 100%;}
#content-wrap:after {left: 100%;}
#content-wrap, #content-wrap:before, #content-wrap:after {background:#666;}
#content-wrap {
position: relative;
width:1000px;
margin:0 auto;
padding:25px 0;
}
最佳答案
您可以添加另一个 div 以包含 #content-wrap div 中的内容,然后应用 overflow: auto;和宽度:100%;对它
<div id="content-wrap">
<div id="content"></div>
</div>
#content {
overflow: auto;
width: 100%;
}
我不知道你的 html,但如果问题是由 div 内部的 float 元素引起的,你可能还想尝试使用 display: inline-block;相反
关于css - 使用 Chris Coyier 全 Angular hack 没有高度,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11425002/
Chris Coyier 写了一个 excellent article通过将 HTML 表格结构化为列表来使 HTML 表格在移动设备上更好。我喜欢这种方法,但我处理的表格是动态的,我不能像他那样真正
我在我正在构建的网站上使用 Chris Coyier 的全宽 hack,但对如何让 div 具有它包含的任何内容的高度感到困惑。 通常我会通过将 overflow:auto 添加到容器中来实现这一点,
我是一名优秀的程序员,十分优秀!