2014-04-10 78 views
0

我遇到的问题仅存在于Firefox中(我正在使用v28)。请参阅我的fiddle以获得视觉解释。Firefox - 由内部元素边距和填充影响的父级边框

基本上,#header-wrap内的内容导致#header-wrap的灰色背景与它的RED底部边界之间的30px左右的间隙。我已经将问题缩小到.jumbotron的底边距为30px,但我不能为我的生活找出为什么它会导致#header-wrap的背景与仅在firefox中的边框之间的差距。

编辑:我看到我的页面的小提琴版本也是在铬合金中做的。但实际的页面只能在Firefox中执行。不过,任何帮助和解释这个问题将不胜感激。

我知道我可以通过.jumbotron去除余量解决这个问题,但我不能问心无愧地做到这一点,继续前进不理解为什么它只是Firefox :)

+0

我不能告诉到底是哪间距您反对。你能编辑小提琴,所以违规区域被涂上红色或其他东西,使其更明显? '.navbar'有一个20px的底部边距,'.jumbotron'有30个底部边距,都在'#header-wrap'内。 '#header-wrap'底部边框与其内容之间的差距似乎是由'.jumbotron'的边距指令造成的。 – Neek

+0

谢谢。我将底部边框更改为红色并更新了小提琴和问题。 – bflemi3

+0

我在Firefox和Chrome中看到jumbotron的灰色内容和红色边框之间的30px空白区域。这只是保证金指令。感觉像我失去了一些东西... – Neek

回答

0

您在良好SHOULD发生良知删除保证金。我只是说你应该使用CSS重置。 :)这只是发生在Firefox,因为它可以在这种情况下这种行为读取默认H3 CSS的

http://www.cssreset.com/

例复位

/** 
* Eric Meyer's Reset CSS v2.0 (http://meyerweb.com/eric/tools/css/reset/) 
* http://cssreset.com 
*/ 
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; 
} 
+0

没有bootstrap没有resset?我正在使用引导程序3 – bflemi3

+0

您已经在normalize.css文件中拥有它:\ – TooShyToAsk

相关问题