html - 超大屏幕图像高度

标签 html twitter-bootstrap css bootstrap-4

我的超大屏幕图像是 1,100 x 687。但是当我将图像添加到超大屏幕时,img 高度仅为 310 像素。我想将高度增加到至少 500(同时在较小的设备上仍然可以响应)。我怎样才能做到这一点?

超大屏幕语法:

.jumbotron{
    background-image: linear-gradient(rgba(0,0,0,0.5), rgba(0,0,0,0.5)), url("../img/colorful_planke.jpg");
    background-size: cover;
}
<div class="jumbotron jumbotron-fluid jumbo_text">
    <div class="container"><br>
        <h1 class="display-4 font-weight-bold text-center">Sell More Online</h1><br>
        <p class="lead text-center font-weight-bold">Web Development | Web Design | Google Analytics | Online Advertising |
            Social Media Advertising</p>
        <br>
        <h2 class="text-center">Let's Make Your Business More Profitable!</h2>
    </div>
</div>

最后,如果您想将大图片添加到主页,是否建议使用 jumbotron,还是应该将其放在普通的 .container 中?

最佳答案

如果你想要更大的 .jumbotron,请设置 min-height:

.jumbotron {
  background-image: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)), url("http://lorempixel.com/1100/667/");
  background-size: cover;
  color: #fff;
  min-height: 500px;
}
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.0/css/bootstrap.min.css" integrity="sha384-9gVQ4dYFwwWSjIDZnLEWnxCjeSWFphJiwGPXr1jddIhOegiu1FwO5qRGvFXOdJZ4" crossorigin="anonymous">

<div class="jumbotron jumbotron-fluid jumbo_text">
  <div class="container"><br>
    <h1 class="display-4 font-weight-bold text-center">Sell More Online</h1><br>
    <p class="lead text-center font-weight-bold">Web Development | Web Design | Google Analytics | Online Advertising | Social Media Advertising</p>
    <br>
    <h2 class="text-center">Let's Make Your Business More Profitable!</h2>
  </div>
</div>

关于html - 超大屏幕图像高度,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51037491/

相关文章:

javascript - 在html Nodejs中显示mongodb数据

javascript - 一个 div 位于另一个 div 中,两者都可点击。当按下内部按钮时,外部按钮也会被触发

html - Bootstrap 右列与左列重叠

html - 使用 CSS 进行网页设计过程 - 期间还是之后?

jquery - 如何在 jQuery Validate 插件中为包装器指定样式?

jquery - Bootstrap 3 中的数字向上和向下(微调控件)

twitter-bootstrap - 将 url 和 hash 与 Bootstrap ScrollSpy 一起使用

html - 按元素编号更改点导航颜色

jquery - 如何向 slider 添加填充?

html - 页面的 Logo 和标题向左浮动,但导航和部分主要内容挡住了去路