不知道這是否是故意的,但你應該只風格的.jumbotron
類一次。
您的額外類別jumboText
使用camelcase,它與當前引導程序類慣例不匹配,使用連字符-
。爲了保持一致性,請在全局上設置標題標籤的樣式,並在層次結構中將它們用於HTML層次結構中,並且從頂部的一個頁面開始,然後根據需要級聯。嘗試儘可能多地使用內置類,並儘量減少定製類,併合理使用它們。
瞭解這個也有點無關,但應該因爲你的新來譜寫,以自舉,但你的<button>
的應該是使用內置類系統引導btn
a
nchor標籤和在你的CSS樣式全局它們。
下面是與「快速響應」的超大屏幕背景FIDDLE: https://jsfiddle.net/jeremykenedy/p1u3aryv/10/
您可能要直到你更熟悉的框架,經常引用這樣的:
http://getbootstrap.com/css/ http://getbootstrap.com/components/ http://getbootstrap.com/javascript/
FIDDLE顯示的內容:
HTML:
<nav class="navbar navbar-inverse navbar-fixed-top">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="#">Project name</a>
</div>
<div id="navbar" class="navbar-collapse collapse">
<form class="navbar-form navbar-right">
<div class="form-group">
<input type="text" placeholder="Email" class="form-control">
</div>
<div class="form-group">
<input type="password" placeholder="Password" class="form-control">
</div>
<button type="submit" class="btn btn-success">Sign in</button>
</form>
</div>
<!--/.navbar-collapse -->
</div>
</nav>
<!-- Main jumbotron for a primary marketing message or call to action -->
<div class="jumbotron">
<div class="container">
<h1>Hello, world!</h1>
<p>This is a template for a simple marketing or informational website. It includes a large callout called a jumbotron and three supporting pieces of content. Use it as a starting point to create something more unique.</p>
<p><a class="btn btn-primary btn-lg" href="#" role="button">Learn more »</a></p>
</div>
</div>
<div class="container">
<!-- Example row of columns -->
<div class="row">
<div class="col-md-4">
<h2>Heading</h2>
<p>Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui. </p>
<p><a class="btn btn-default" href="#" role="button">View details »</a></p>
</div>
<div class="col-md-4">
<h2>Heading</h2>
<p>Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui. </p>
<p><a class="btn btn-default" href="#" role="button">View details »</a></p>
</div>
<div class="col-md-4">
<h2>Heading</h2>
<p>Donec sed odio dui. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Vestibulum id ligula porta felis euismod semper. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus.</p>
<p><a class="btn btn-default" href="#" role="button">View details »</a></p>
</div>
</div>
<hr>
<footer>
<p>© 2016 Company, Inc.</p>
</footer>
</div>
<!-- /container -->
CSS:
.jumbotron {
background: url(https://s3-us-west-2.amazonaws.com/consultjeremy.com/backgrounds/about-bg.jpg) no-repeat center center;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
min-height: 600px;
color: #ffffff;
}
你確定了 「JoelCanada.jpg」 好不好?因爲我用Unsplash的一個很好的大圖片試了這個,沒有問題。 [jsfiddle](https://jsfiddle.net/tfantina/jzdbm3h9/) – tfantina
您不僅應該展示您試圖用來解決問題的代碼,還應該展示重現問題本身的所有必要內容。請這樣做。 – YakovL
我有一種感覺,那麼圖像可能是一個問題。你能解釋一下圖像需要對這種情況有用嗎?尺寸/文件類型等。 – rarizzu