Alert - Cảnh báo
1. Alert - Cảnh báo Là thành phần đầu tiên của bootstrap giúp bạn có thể hiện thông báo hoặc đánh dấu một ngữ cảnh nổi bật.
Dưới đây là một ví dụ đầu tiên.
This is a primary alert—check it out!
This is a secondary alert—check it out!
This is a success alert—check it out!
This is a danger alert—check it out!
This is a warning alert—check it out!
This is a info alert—check it out!
This is a light alert—check it out!
This is a dark alert—check it out!
<div class="alert alert-primary" role="alert">
This is a primary alert—check it out!
</div>
<div class="alert alert-secondary" role="alert">
This is a secondary alert—check it out!
</div>
<div class="alert alert-success" role="alert">
This is a success alert—check it out!
</div>
<div class="alert alert-danger" role="alert">
This is a danger alert—check it out!
</div>
<div class="alert alert-warning" role="alert">
This is a warning alert—check it out!
</div>
<div class="alert alert-info" role="alert">
This is a info alert—check it out!
</div>
<div class="alert alert-light" role="alert">
This is a light alert—check it out!
</div>
<div class="alert alert-dark" role="alert">
This is a dark alert—check it out!
</div>
Nếu bạn muốn thêm một link vào trong cảnh báo. Bạn có thể sử dụng class ".alert-link"
This is a primary alert with an example link. Give it a click if you like.
This is a secondary alert with an example link. Give it a click if you like.
This is a success alert with an example link. Give it a click if you like.
This is a danger alert with an example link. Give it a click if you like.
This is a warning alert with an example link. Give it a click if you like.
This is a info alert with an example link. Give it a click if you like.
This is a light alert with an example link. Give it a click if you like.
This is a dark alert with an example link. Give it a click if you like.
<div class="alert alert-primary" role="alert">
This is a primary alert with <a class="alert-link" href="https://www.blogger.com/blogger.g?blogID=3954554342840079906#">an example link</a>. Give it a click if you like.
</div>
<div class="alert alert-secondary" role="alert">
This is a secondary alert with <a class="alert-link" href="https://www.blogger.com/blogger.g?blogID=3954554342840079906#">an example link</a>. Give it a click if you like.
</div>
<div class="alert alert-success" role="alert">
This is a success alert with <a class="alert-link" href="https://www.blogger.com/blogger.g?blogID=3954554342840079906#">an example link</a>. Give it a click if you like.
</div>
<div class="alert alert-danger" role="alert">
This is a danger alert with <a class="alert-link" href="https://www.blogger.com/blogger.g?blogID=3954554342840079906#">an example link</a>. Give it a click if you like.
</div>
<div class="alert alert-warning" role="alert">
This is a warning alert with <a class="alert-link" href="https://www.blogger.com/blogger.g?blogID=3954554342840079906#">an example link</a>. Give it a click if you like.
</div>
<div class="alert alert-info" role="alert">
This is a info alert with <a class="alert-link" href="https://www.blogger.com/blogger.g?blogID=3954554342840079906#">an example link</a>. Give it a click if you like.
</div>
<div class="alert alert-light" role="alert">
This is a light alert with <a class="alert-link" href="https://www.blogger.com/blogger.g?blogID=3954554342840079906#">an example link</a>. Give it a click if you like.
</div>
<div class="alert alert-dark" role="alert">
This is a dark alert with <a class="alert-link" href="https://www.blogger.com/blogger.g?blogID=3954554342840079906#">an example link</a>. Give it a click if you like.
</div>
Thêm một số nội dung như một phần riêng biệt
Well done!
Aww yeah, you successfully read this important alert message. This example text is going to run a bit longer so that you can see how spacing within an alert works with this kind of content.
Whenever you need to, be sure to use margin utilities to keep things nice and tidy.
<div class="alert alert-success" role="alert">
<h4 class="alert-heading">Well done!</h4>
Aww yeah, you successfully read this important alert message. This example text is going to run a bit longer so that you can see how spacing within an alert works with this kind of content.<br />
<hr>
<div class="mb-0">
Whenever you need to, be sure to use margin utilities to keep things nice and tidy.</div>
</div>
Bạn cũng có thể sử dụng cảnh báo loại bỏ giống như sau:
Holy guacamole! You should check in on some of those fields below.
<div class="alert alert-warning alert-dismissible fade show" role="alert">
<strong>Holy guacamole!</strong> You should check in on some of those fields below.
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>