【问题标题】:Bootstrap results going awry in Chrome引导结果在 Chrome 中出错
【发布时间】:2017-07-26 23:35:49
【问题描述】:

我的网站的某个部分有问题,但该问题仅出现在 Chrome 中(老实说,还没有尝试过 Firefox)。在 Safari 中,“关于”div(如下所示)以正确的比例显示得很好,但在 Chrome 中,p 元素看起来太低了,大部分都在浏览器的左边缘,不可读,#about_bg 部分太正确而且行为不端。有什么想法吗?

链接在这里:http://www.smoakvoiceover.com/#about

<!-- ABOUT -->
<div id="about" class="container-fluid">
  <div class="wrapper">
    <div class="row">
      <div id="about_bg" class="col-sm-3 col-sm-push-9">
        <img id="question_glyph" class="center-block" src="img/question_glyph.png" alt="about" />
        <h3 id="question_glyph_alt" alt="about">ABOUT.</h3>
      </div>
      <div class="col-sm-9 col-sm-pull-3 about_container">
        <p class="about_text">
          Outside of being "the voice," Bradley Smoak has had a variety of jobs throughout his career, most notably being an internationally acclaimed <a class="discreet" target="_blank" href="http://www.bradleysmoak.com">operatic soloist</a> featured at some of the top opera companies in the world.
          <br />
          <br />
          Other jobs have included bartender, boat renter, poker dealer, steakhouse cook, steakhouse waiter, steakhouse customer, website developer, illustrator, and computer game tester. From these incredibly diverse experiences, he brings a unique perspective to his voice acting and the ability to create a variety of specific, relatable characters that bring your copy to life.
          <br />
          <br />
          Originally from North Carolina, Bradley now makes his home in the wonderful Chicagoland area with his gorgeous wife and daughter, who put up with his "crazy voices" every day.
        </p>
      </div>
    </div>
    <div class="row">
      <div id="about_arrow" class="text-center">
        <a href="#services"><span class="text-center glyphicon glyphicon-circle-arrow-down"></span></a>
      </div>
    </div>
  </div>
</div>

这是对应的.scss代码(通过SASS编译后):

#about {
  background: url('../img/about_bg.jpg');
  background-size: cover !important;
  background-attachment: fixed;
  margin-bottom: -65px !important;
  z-index: 2 !important;
  position:relative;
  top:-57px !important;
}
#about_bg { 
  background-color: rgba(0, 0, 0, 0.825);
}
#question_glyph { 
  width: 50%;
  padding:220px 0px 270px 0px;
}
#question_glyph_alt { display: none; }
.about_container {
  margin: 250px auto;
  padding: 30px 35px;
  max-width:740px;
  text-align: left;
}
p.about_text { 
  color:#000 !important;
  font-size: 15px; 
}
#about_arrow > a {
  color: $white;
  width:40px;
  margin:0px auto;
  position:relative;
  bottom:100px;
  &:hover { color: $steel; }
}

感谢观看!

【问题讨论】:

    标签: css twitter-bootstrap google-chrome sass


    【解决方案1】:

    在 Bootstrap 列的左侧和右侧添加填充和边距将导致列超过包装器的最大宽度(如果您的列等于 12)并且内容将换行。

    【讨论】:

    • 取出 col-- divs 的所有左/右填充和边距,问题仍然存在......知道为什么这在 Safari 和不在 Chrome 中?
    • 这是个好问题,但我不知道答案。除了您可能将样式应用于在 Chrome 中呈现不同的元素之外。我没有Safari,所以我无法查看。通过删除 push 和 pull 列类并在 about_bg ID 上应用正确的浮点数,我能够使它看起来更好。但我确定这不是你想要的。对不起,我没有更多的帮助!我认为推拉可能是问题所在,但这只是一个猜测,因为我没有要测试的 Safafi。
    猜你喜欢
    • 1970-01-01
    • 2016-07-22
    • 2020-09-21
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-10-05
    • 1970-01-01
    • 2011-04-29
    相关资源
    最近更新 更多