Bootstrap 4 Jumbotron With Examples

admin_img Posted By Bajarangi soft , Posted On 12-10-2020

A jumbotron is a big grey box used to indicate some text which requires extra attention. Any text that seems to be important can be written inside a jumbotron to make it appear big and noticeable.

Jumbotron Bootstrap

Steps to add jumbotron:

  • Use a jumbotron class inside a div element.
  • Write any text inside the div tag.
  • Close the div element.
Syntax
<div class="jumbtron"> Contents... <div>
Example-1
<!DOCTYPE html>
<html lang="en">
<head>
    <title>Bootstrap Jumbotron</title>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css">
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js"></script>
    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js"></script>
</head>

<body style="text-align:center;">
<div class="container">
    <div class="jumbotron">
        <h1 style="color:#d26109;">BAJARANGI SOFT</h1>
        <p>A computer science portal for geeks</p>
    </div>
</div>
</body>
</html>
Full-width Jumbotron: The .jumbotron-fluid and .container or .container-fluid classes is used to create a full-width jumbotron without rounded borders.
Syntax:
<div class="jumbotron jumbotron-fluid">
    <div class="container"> Contents... <div>
<div>
Example-2
<!DOCTYPE html>
<html lang="en">
<head>
    <title>Bootstrap Jumbotron</title>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css">
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js"></script>
    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js"></script>
</head>

<body style="text-align:center;">
<div class="jumbotron jumbotron-fluid">
    <div class="container">
        <h1 style="color:#e78b29;">
           BAJARANGI SOFT
        </h1>

        <p>A computer science portal for Web Developers</p>
    </div>
</div>

<p>Text content outside the jumbotron</p>
</body>

</html>

Related Post