Bootstrap4 超大屏幕Jumbotron

2018-05-28 14:11 更新

Jumbotron(超大屏幕)是Bootstrap4支持的一個(gè)特性,使用該功能可以增加標(biāo)題的大小,并為登陸頁(yè)面內(nèi)容添加更多的外邊距。

提示: Jumbotron 里頭可以放一些 HTML標(biāo)簽,也可以是 Bootstrap 的元素。


使用方法:

我們可以通過(guò)在 <div> 元素 中添加 .jumbotron 類來(lái)創(chuàng)建 jumbotron:

實(shí)例

<!DOCTYPE html>
<html>
<head>
  <title>Bootstrap4 實(shí)例</title>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="stylesheet"  rel="external nofollow" target="_blank"  rel="external nofollow" target="_blank" >
  <script src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js" rel="external nofollow"  rel="external nofollow" ></script>
  <script src="https://cdn.bootcss.com/popper.js/1.12.5/umd/popper.min.js" rel="external nofollow"  rel="external nofollow" ></script>
  <script src="https://cdn.bootcss.com/bootstrap/4.1.0/js/bootstrap.min.js" rel="external nofollow"  rel="external nofollow" ></script>
</head>
<body>
<div class="container">
  <div class="jumbotron">
    <h1>W3Cschool</h1> 
    <p>學(xué)編程,從W3Cschool開始!</p> 
  </div>
  <p>這是一些文本。</p>      
  <p>這是一些文本。</p>      
</div>
</body>
</html>


全屏幕的 Jumbotron

如果你想創(chuàng)建一個(gè)沒(méi)有圓角的全屏幕,可以在 .jumbotron-fluid 類里頭的 div添加 .container 或 .container-fluid 類來(lái)實(shí)現(xiàn):

實(shí)例

<!DOCTYPE html>
<html>
<head>
  <title>Bootstrap 實(shí)例</title>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="stylesheet"  rel="external nofollow" target="_blank"  rel="external nofollow" target="_blank" >
  <script src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js" rel="external nofollow"  rel="external nofollow" ></script>
  <script src="https://cdn.bootcss.com/popper.js/1.12.5/umd/popper.min.js" rel="external nofollow"  rel="external nofollow" ></script>
  <script src="https://cdn.bootcss.com/bootstrap/4.1.0/js/bootstrap.min.js" rel="external nofollow"  rel="external nofollow" ></script>
</head>
<body>
<div class="jumbotron jumbotron-fluid">
  <div class="container">
    <h1>W3Cschool</h1> 
    <p>學(xué)編程,從W3Cschool開始!</p>
  </div>
</div>
<div class="container">
  <p>是一些文本。</p>      
  <p>是一些文本。</p>      
</div>
</body>
</html>


以上內(nèi)容是否對(duì)您有幫助:
在線筆記
App下載
App下載

掃描二維碼

下載編程獅App

公眾號(hào)
微信公眾號(hào)

編程獅公眾號(hào)