我正在尝试将内部子div拉伸到窗口的剩余大小,同时将其限制为最小高度。请参阅此插件http://plnkr.co/edit/AxmB8RoYKY95GQqOVG7h?p=preview
子div延伸到剩余空间,并且它不会像预期的那样小于最小高度,但仅限于Firefox和IE。当我在Chrome中测试时,拉伸的div在达到最小高度时会崩溃。
样式有问题还是有解决方法?
这是我测试的浏览器版本: Firefox:27,IE 11和Chrome 32
答案 0 :(得分:0)
如果它在其他浏览器中有效,它可能只是一个chrome项目,因为html中没有'Standard',每个浏览器都有自己预先构建的css。他们中的大多数看起来很标准,但有时会引起问题。
您可以尝试使用此代码执行css重置,这对我在去年工作的项目上有用。
/* http://meyerweb.com/eric/tools/css/reset/
v2.0 | 20110126
License: none (public domain)
*/
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed,
figure, figcaption, footer, header, hgroup,
menu, nav, output, ruby, section, summary,
time, mark, audio, video {
margin: 0;
padding: 0;
border: 0;
font-size: 100%;
font: inherit;
vertical-align: baseline;
}
/* HTML5 display-role reset for older browsers */
article, aside, details, figcaption, figure,
footer, header, hgroup, menu, nav, section {
display: block;
}
body {
line-height: 1;
}
ol, ul {
list-style: none;
}
blockquote, q {
quotes: none;
}
blockquote:before, blockquote:after,
q:before, q:after {
content: '';
content: none;
}
table {
border-collapse: collapse;
border-spacing: 0;
}