📜  bootstrap 5 jumbotron - Html (1)

📅  最后修改于: 2023-12-03 15:13:41.194000             🧑  作者: Mango

Bootstrap 5 Jumbotron - Html

The Bootstrap 5 Jumbotron is a responsive container that can be used to highlight important content on a web page. It is a great way to draw attention to specific text or images that you want your visitors to see first. The Jumbotron is easy to use, customizable, and can be added to any HTML file with just a few lines of code.

Usage

To add a Jumbotron to your web page, you will need to include the Bootstrap 5 CSS and JavaScript files in the head section of your HTML file. You can do this by adding the following code:

<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/5.0.1/css/bootstrap.min.css" integrity="sha512-BTfTmu1e0b28+oKqZMz+dya+YK14JzDt6ppt3q6m9XKf+UysRJG6xQd02ZtfI7VQzDY5u5XFmyS5xDlKX7VlNQ==" crossorigin="anonymous" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/5.0.1/js/bootstrap.min.js" integrity="sha512-4otxRY4ebzTHcORMtlvsj0opLl3kqXXTd6XNYj6xcLPCE6UJ/y6d2Zvw45bUhMcY42EZOmcvfSKjz+fvlWZe9A==" crossorigin="anonymous"></script>

Once you have added the necessary files, you can create a Jumbotron by adding the following HTML code to your web page:

<div class="jumbotron">
  <h1>Hello, world!</h1>
  <p>This is a simple hero unit, a simple jumbotron-style component for calling extra attention to featured content or information.</p>
  <a class="btn btn-primary btn-lg" href="#" role="button">Learn more</a>
</div>

This will create a basic Jumbotron with a heading, paragraph, and button. You can customize the Jumbotron by adding classes to the div element. For example, you can add the "bg-primary" class to change the background color to a primary color.

Conclusion

The Bootstrap 5 Jumbotron is a versatile and useful component that can help you draw attention to important content on your web page. It is easy to use and customize, and can be added to any HTML file with just a few lines of code. Give it a try on your next web project!