codecamp

Bootstrap 超大屏幕(Jumbotron)

Bootstrap的超大屏幕(jumbotron)组件显示网页上的关键内容。

只需在一个<div>元素中包含特征内容,如标题,描述等,并应用.jumbotron类。

<!DOCTYPE html>
<html lang="en">
<head>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap-theme.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/js/bootstrap.min.js"></script>
<style type="text/css">
    .jumbotron{
      margin-top: 15px;
    }
</style>
</head>
<body>
<div class="container">
  <div class="row">
      <div class="col-xs-12">
          <div class="jumbotron">
                <h1>Learn to Create Websites</h1>
              <p>This is a test. This is a test. This is a test. This is a test. 
              This is a test. This is a test. This is a test. This is a test. 
              This is a test. This is a test. This is a test. This is a test. </p>
              <p><a href="" target="_blank" class="btn btn-primary btn-lg">Get started today</a></p>
            </div>
        </div>
    </div>
</div>
</body>
</html>

全屏尺寸

要创建没有圆角的超大屏幕(jumbotron)并覆盖视频口的全部宽度,将其放置在所有容器外,并在其中添加.container。

<!DOCTYPE html>
<html lang="en">
<head>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap-theme.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/js/bootstrap.min.js"></script>
</head>
<body>
<div class="jumbotron">
    <div class="container">
        <h1>Learn to Create Websites</h1>
        <p>This is a test. This is a test. This is a test. This is a test. This is a test. 
        This is a test. This is a test. This is a test. This is a test. </p>
        <p><a href="" target="_blank" class="btn btn-primary btn-lg">Get started today</a></p>
    </div>
</div>
</body>
</html>

Bootstrap 图片
Bootstrap 标签和徽章
温馨提示
下载编程狮App,免费阅读超1000+编程语言教程
取消
确定
目录

Bootstrap 介绍

关闭

MIP.setData({ 'pageTheme' : getCookie('pageTheme') || {'day':true, 'night':false}, 'pageFontSize' : getCookie('pageFontSize') || 20 }); MIP.watch('pageTheme', function(newValue){ setCookie('pageTheme', JSON.stringify(newValue)) }); MIP.watch('pageFontSize', function(newValue){ setCookie('pageFontSize', newValue) }); function setCookie(name, value){ var days = 1; var exp = new Date(); exp.setTime(exp.getTime() + days*24*60*60*1000); document.cookie = name + '=' + value + ';expires=' + exp.toUTCString(); } function getCookie(name){ var reg = new RegExp('(^| )' + name + '=([^;]*)(;|$)'); return document.cookie.match(reg) ? JSON.parse(document.cookie.match(reg)[2]) : null; }