html - Bootstrap 多个超大屏幕

标签 html css twitter-bootstrap

我正在尝试建立一个网站,我最初的想法是需要 2 个重叠的超大屏幕 - 使用 bootstrap 3。 1 个超大屏幕 - 拉伸(stretch) 100% 的宽度 - 传统的灰色着色。 1 个重叠 - 减小到“容器”大小的附加超大屏幕 - 但这将具有图像背景。

第一次尝试 - 使用重叠的超大屏幕 - 这允许响应式成像,但是全宽超大屏幕的大小与重叠图像的大小不匹配。

<div class = "jumbotron">
<div class ="jumbotron container>//image 
 <p>Sample text</p>
</div>
</div>

第二种方式 - 使用 1 个超大屏幕 - 但是这会阻止我的图像响应:

<div class="jumbotron">
    <div class="row">   
     <div class="col-md-8">
   <div class="jumbpic">
    <img src="style/images/car2.png"></div></div>
    <div class="col-md-4">
     <p>Sample text</p>

是否有一个简单的替代方案来允许全宽超大屏幕但允许中央图像也可以响应屏幕尺寸?

最佳答案

我可能没有完全理解您的问题,但是将超大屏幕包裹在 .well 中怎么样?

这会为您提供超大屏幕内的响应式图像,并为您提供所需的灰色封闭背景。只需将 .img-responsive 类添加到您的图像,使其响应,并确保它是一个足够大的图像来填充屏幕。我添加了 .center-block 类来使图像居中。

编辑以删除评论中每个 OP 的超大屏幕填充

<style>
    .jumbotron {
        padding-top: 0;
    }
</style>

<div class="well">
    <div class="jumbotron">
        <img src="http://placehold.it/1920x800" class="img-responsive center-block">
        <p>Sample text</p>
    </div>
</div>

Fiddle...


编辑:这将为您提供一个带有背景图像的超大屏幕。同样,请确保您使用的是大图像...

<style>
    .jumbotron {
        background: url('http://p1.pichost.me/i/59/1828782.jpg');
        color: white;
    }
</style>

<div class="well">
    <div class="jumbotron">
        <div class="container">
            <h1>Hello, world!</h1>
            <p>Sample text</p>
            <p><a class="btn btn-primary btn-lg" href="#" role="button">Learn more</a></p>
        </div>
    </div>
</div>

Fiddle...

关于html - Bootstrap 多个超大屏幕,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30132213/

相关文章:

html - 为什么媒体查询的优先级低于无媒体查询 css

javascript - 如何在 Chrome 扩展内容脚本中限定 CSS

html - 如何使菜单可以越过 Logo ?

css - Bootstrap 下拉菜单 : change dropdown icon when it's active?

html - 如何水平对齐两个div?

html - 你会认为 HTML + CSS + Webserver 是 MVC 吗?

javascript - 如何在 Javascript 中创建数学上正确且可接受的除法

html - 在 IE11 中使容器高度适合响应式图像

css - 当您将鼠标悬停在文本上时如何使文本发生变化而不抽搐?

javascript - 通过按下拉按钮更改段落内的文本