【问题标题】:Bootstrap Jumbotron is not adjusting to topBootstrap Jumbotron 没有调整到顶部
【发布时间】:2016-03-03 11:16:39
【问题描述】:

我的 jumbotron 没有按预期工作。这是我的代码:

  <div class="jumbotron fill-jumbotron">
        <div class="container" id="outer">
            <h1 align="center" id="mapsHead">Google Maps Filter</h1>
            <div id="map"></div>
        </div>
    </div>

这是我的 CSS:

    .fill-jumbotron{
    height:100%;
    background: url('../assets/images/city2.jpg') no-repeat center center;
    }

我尝试将 body 强制为 100%,margin 为 0,padding:0!important; . div #map 包含从 api 加载的谷歌地图。根据这个 bootply,我的 jumbotron 应该可以正常工作,但它不是:

http://www.bootply.com/MlRhkzU5GR

我的视口初始比例设置为 1,我尝试从不同的浏览器加载我的网页。 Chrome 开发者显示,在 jumbotron 的顶部,jumbotron(body)之外有一个空白区域。

编辑:

通过更新引导库解决了问题。

【问题讨论】:

  • 你能展示一下它与 bootply 相比的外观吗?
  • 你的意思是模拟错误?
  • 是的,我就是这个意思
  • jsfiddle.net/efcbhcv0 像这样,我不得不在 css 中强制 margin:top 来模拟错误。

标签: twitter-bootstrap-3


【解决方案1】:

尝试在 CSS 中将 top 设置为 0,div 应紧贴顶部。

【讨论】:

  • 我强迫它显示错误,我的真实 css 中没有那个 margin-top。
  • 更新的答案 您为 jumbotron 发布的 HTML 代码是迄今为止您在页面上唯一拥有的东西?
猜你喜欢
  • 1970-01-01
  • 2020-11-29
  • 2017-05-28
  • 2014-01-18
  • 1970-01-01
  • 2011-11-17
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多