简体   繁体   English

野生动物园的边缘顶部不同于chrome和Firefox

[英]safari margin top different than chrome and firefox

I currently am using a margin to push page content out from under a fixed header. 我目前正在使用页边距将页面内容从固定的标题下推出。 To match the header's height of 110px, i've given the content a margin of 110px. 为了匹配标题的110px高度,我给内容设置了110px的空白。 I've seen safari having issues with margin % but not with a set pixel size. 我见过野生动物园的裕度百分比有问题,但像素大小没有问题。 For complicated reasons this needs to be done with a top margin, but safari is ignoring it. 出于复杂的原因,这需要以最高的边距完成,但野生动物园却忽略了它。 It does say when i view the source that there is a margin of 110px, but it's behaving as if there's a margin of ~20px. 它确实说,当我查看源代码时,边距为110px,但是它的行为好像在边距为〜20px。 So: 所以:

  1. why is this happening? 为什么会这样呢?
  2. how do i fix it? 我如何解决它?

EDIT 编辑

This is built on a bootstrap theme from hell. 这是基于地狱的引导主题构建的。

I think padding is no option here? 我认为在这里没有填充选项? have you tried applying box-sizing: border-box to your CSS? 您是否尝试过将box-sizing:border-box应用于CSS?

html {
box-sizing: border-box;
}
*, *:before, *:after {
box-sizing: inherit;
}

EDIT: have you tried 编辑:您是否尝试过

top: 110px;

?

EDIT: Adding a DIV with the height of 110px? 编辑:添加高度为110像素的DIV? Brute force ... ;) Ten years ago i would have used a transparent 1x1px GIF and set it's height to 110px. 蛮力...;)十年前,我会使用透明的1x1px GIF并将其高度设置为110px。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM