<div class="alert alert-success alert-white rounded">
<button type="button" class="close closebtn" onclick="this.parentElement.style.display='none';">×</button>
<div class="icon"><i class="fas fa-check"></i></div>
<strong class="alert-head">Success!</strong> This is a success message.
</div>
<div class="alert alert-info alert-white rounded">
<button type="button" class="close closebtn" onclick="this.parentElement.style.display='none';">×</button>
<div class="icon"><i class="fas fa-info-circle"></i></div>
<strong class="alert-head">Info!</strong> This is an info message.
</div>
<div class="alert alert-warning alert-white rounded">
<button type="button" class="close closebtn" onclick="this.parentElement.style.display='none';">×</button>
<div class="icon"><i class="fas fa-exclamation-triangle"></i></div>
<strong class="alert-head">Warning!</strong> This is a warning message.
</div>
<div class="alert alert-danger alert-white rounded">
<button type="button" class="close closebtn" onclick="this.parentElement.style.display='none';">×</button>
<div class="icon"><i class="fas fa-times-circle"></i></div>
<strong class="alert-head">Danger!</strong> This is a danger message.
</div>
.close {
font-size: 21px;
font-weight: bold;
line-height: 1;
color: #000;
text-shadow: 0 1px 0 #fff;
opacity: .2;
}
.close:hover,
.close:focus {
color: #000;
text-decoration: none;
cursor: pointer;
opacity: .5;
}
button.close {
padding: 0;
cursor: pointer;
background: transparent;
border: 0;
-webkit-appearance: none;
position: absolute;
right: 10px;
top: 10px;
}
.alert {
padding: 15px;
margin-bottom: 20px;
border: 1px solid transparent;
border-radius: 4px;
display: flex;
flex-direction: column;
}
.alert h4 {
margin-top: 0;
color: inherit;
}
.alert .alert-link {
font-weight: bold;
}
.alert>p,
.alert>ul {
margin-bottom: 0;
}
.alert>p+p {
margin-top: 5px;
}
.alert-dismissable {
padding-right: 35px;
}
.alert-dismissable .close {
position: relative;
top: -2px;
right: -21px;
color: inherit;
}
.alert-success {
background-color: #dff0d8;
border-color: #d6e9c6;
color: #3c763d;
}
.alert-success hr {
border-top-color: #c9e2b3;
}
.alert-success .alert-link {
color: #2b542c;
}
.alert-info {
background-color: #d9edf7;
border-color: #bce8f1;
color: #31708f;
}
.alert-info hr {
border-top-color: #a6e1ec;
}
.alert-info .alert-link {
color: #245269;
}
.alert-warning {
background-color: #fcf8e3;
border-color: #faebcc;
color: #8a6d3b;
}
.alert-warning hr {
border-top-color: #f7e1b5;
}
.alert-warning .alert-link {
color: #66512c;
}
.alert-danger {
background-color: #f2dede;
border-color: #ebccd1;
color: #a94442;
}
.alert-danger hr {
border-top-color: #e4b9c0;
}
.alert-danger .alert-link {
color: #843534;
}
.alert {
border-radius: 0;
-webkit-border-radius: 0;
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2);
}
.alert:hover {
border-radius: 0;
-webkit-border-radius: 0;
box-shadow: 0 8px 16px 0 rgba(0, 0, 0, 0.2);
}
.alert .sign {
font-size: 20px;
vertical-align: middle;
margin-right: 5px;
text-align: center;
width: 25px;
display: inline-block;
}
.alert-success {
background-color: #dbf6d3;
border-color: #aed4a5;
color: #569745;
}
.alert-info {
background-color: #d9edf7;
border-color: #98cce6;
color: #3a87ad;
}
.alert-warning {
background-color: #fcf8e3;
border-color: #f1daab;
color: #c09853;
}
.alert-danger {
background-color: #f2dede;
border-color: #e0b1b8;
color: #b94a48;
}
.alert-white {
background-image: linear-gradient(to bottom, #ffffff, #ffffff);
border-top-color: #ffffff;
border-bottom-color: #ffffff;
border-left-color: #ffffff;
border-right-color: #ffffff;
color: #404040;
padding-left: 61px;
position: relative;
}
.alert-white .icon {
text-align: center;
width: 45px;
height: 90%;
position: absolute;
top: 6%;
left: 3px;
border: 1px solid #bdbdbd;
}
.alert-white .icon:after {
-webkit-transform: rotate(45deg);
-moz-transform: rotate(45deg);
-ms-transform: rotate(45deg);
-o-transform: rotate(45deg);
-webkit-transform: rotate(45deg);
display: block;
content: '';
width: 10px;
height: 10px;
border: 1px solid #bdbdbd;
position: absolute;
border-left: 0;
border-bottom: 0;
top: 50%;
right: -6px;
margin-top: -5px;
background: #fff;
}
.alert-white.rounded {
border-radius: 3px;
-webkit-border-radius: 3px;
}
.alert-white.rounded .icon {
border-radius: 3px 0 0 3px;
-webkit-border-radius: 3px 0 0 3px;
}
.alert-white .icon i {
font-size: 20px;
color: #FFF;
left: 12px;
margin-top: -10px;
position: absolute;
top: 50%;
}
.alert-white.alert-danger .icon,
.alert-white.alert-danger .icon:after {
border-color: #f28783;
background: #f28783;
}
.alert-white.alert-info .icon,
.alert-white.alert-info .icon:after {
border-color: #8eafdd;
background: #8eafdd;
}
.alert-white.alert-warning .icon,
.alert-white.alert-warning .icon:after {
border-color: #e8bd7d;
background: #e8bd7d;
}
.alert-white.alert-success .icon,
.alert-white.alert-success .icon:after {
border-color: #a2d8bc;
background: #a2d8bc;
}
.alert-head {
padding-right: 10px;
}
<script>
// Get all alert elements
var alerts = document.getElementsByClassName("alert");
// Show all alerts
for (var i = 0; i < alerts.length; i++) {
alerts[i].style.display = "flex";
}
</script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css"/>
We use cookies to improve your experience. By using our site, you agree to our cookie policy.