阅读(1527) (10)

Bootstrap4 超大屏幕Jumbotron

2018-05-28 13:56:17 更新

Jumbotron(超大屏幕)是Bootstrap4支持的一个特性,使用该功能可以增加标题的大小,并为登陆页面内容添加更多的外边距。

提示: Jumbotron 里头可以放一些 HTML标签,也可以是 Bootstrap 的元素。


使用方法:

我们可以通过在 <div> 元素 中添加 .jumbotron 类来创建 jumbotron:

实例

<!DOCTYPE html>
<html>
<head>
  <title>Bootstrap4 实例</title>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="stylesheet" href="https://cdn.bootcss.com/bootstrap/4.1.0/css/bootstrap.min.css" 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>学编程,从W3Cschool开始!</p> 
  </div>
  <p>这是一些文本。</p>      
  <p>这是一些文本。</p>      
</div>
</body>
</html>


全屏幕的 Jumbotron

如果你想创建一个没有圆角的全屏幕,可以在 .jumbotron-fluid 类里头的 div添加 .container 或 .container-fluid 类来实现:

实例

<!DOCTYPE html>
<html>
<head>
  <title>Bootstrap 实例</title>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="stylesheet" href="https://cdn.bootcss.com/bootstrap/4.1.0/css/bootstrap.min.css" 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>学编程,从W3Cschool开始!</p>
  </div>
</div>
<div class="container">
  <p>是一些文本。</p>      
  <p>是一些文本。</p>      
</div>
</body>
</html>