Toggle navigation
Bootsnipp
Bootstrap
For
CSS Frameworks
Bootstrap
Foundation
Semantic UI
Materialize
Pure
Bulma
References
CSS Reference
Tools
Community
Page Builder
Form Builder
Button Builder
Icon Search
Dan's Tools
Diff / Merge
Color Picker
Keyword Tool
Web Fonts
.htaccess Generator
Favicon Generator
Site Speed Test
Snippets
Featured
Tags
By Bootstrap Version
4.1.1
4.0.0
3.3.0
3.2.0
3.1.0
3.0.3
3.0.1
3.0.0
2.3.2
Register
Login
"Bootstrap Alert Box Alternative With Working Dismissal"
Bootstrap 4.1.1 Snippet by
DJRedNightMC
4.1.1
Preview
HTML
CSS
View Full Screen
Fork
Fork this
3.8K
 
2 Fav
Post to Facebook
Tweet this
<link href="//maxcdn.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css"> <script src="//maxcdn.bootstrapcdn.com/bootstrap/4.1.1/js/bootstrap.min.js"></script> <script src="//cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> <!------ Include the above in your HEAD tag ----------> <div class="container m-2"> <div class="row justify-content-center"> <div class="col-sm-6"> <div class="notice notice-primary alert fade show" role="alert"> <button type="button" class="close" data-dismiss="alert" aria-label="Close"> <span aria-hidden="true">×</span> </button> <strong>Something to note:</strong> <br> Some message here! </div> <div class="notice notice-secondary alert fade show" role="alert"> <button type="button" class="close" data-dismiss="alert" aria-label="Close"> <span aria-hidden="true">×</span> </button> <strong>Something to note:</strong> <br> Some message here! </div> <div class="notice notice-success alert fade show" role="alert"> <button type="button" class="close" data-dismiss="alert" aria-label="Close"> <span aria-hidden="true">×</span> </button> <strong>You've done it!</strong> <br> Some message here! </div> <div class="notice notice-info alert fade show" role="alert"> <button type="button" class="close" data-dismiss="alert" aria-label="Close"> <span aria-hidden="true">×</span> </button> <strong>Here's a little information:</strong> <br> Some message here! </div> <div class="notice notice-warning alert fade show" role="alert"> <button type="button" class="close" data-dismiss="alert" aria-label="Close"> <span aria-hidden="true">×</span> </button> <strong>Something Went Wrong!</strong> <br> Some message here! </div> <div class="notice notice-danger alert fade show" role="alert"> <button type="button" class="close" data-dismiss="alert" aria-label="Close"> <span aria-hidden="true">×</span> </button> <strong>Something went horribly wrong!</strong> <br> Some message here! </div> </div> </div> </div>
.notice { padding: 15px; background-color: #fafafa; margin-bottom: 10px; -webkit-box-shadow: 0 5px 8px -6px rgba(0,0,0,.2); -moz-box-shadow: 0 5px 8px -6px rgba(0,0,0,.2); box-shadow: 0 5px 8px -6px rgba(0,0,0,.2); } .notice-sm { padding: 10px; font-size: 80%; } .notice-lg { padding: 35px; font-size: large; } /* Primary */ .notice-primary { border-left: 6px solid #cce5ff !important; } .notice-primary>strong { color: #004085; } /* Secondary */ .notice-secondary { border-left: 6px solid #e2e3e5 !important; } .notice-secondary>strong { color: #383d41; } /* Success */ .notice-success { border-left: 6px solid #d4edda !important; } .notice-success>strong { color: #155724; } /* Information */ .notice-info { border-left: 6px solid #d1ecf1 !important; } .notice-info>strong { color: #0c5460; } /* Warning */ .notice-warning { border-left: 6px solid #fff3cd !important; } .notice-warning>strong { color: #856404; } /* Danger */ .notice-danger { border-left: 6px solid #f8d7da !important; } .notice-danger>strong { color: #721c24; }
Questions / Comments:
Post
Posting Guidelines
Formatting
- Now
×
Close
Donate
BTC: 12JxYMYi6Vt3mx3hcmP3B2oyFiCSF3FhYT
ETH: 0xCD715b2E3549c54A40e6ecAaFeB82138148a6c76