So first, some basic ones...
Colored Table With Stripes
So actually this is very easy thanks to table-* classes
(*
stands for basic color names). The stripe effects are generated by class table-hover
. So the full code is:
Actually you can use those color names just for the colors, don't care about what "warning
" or "primary
" means. Got it?
A reproduction of Jumbotron
Jumbotron
is a kind of big screen(super big!) to convey important message or information you want you highlight. It was added to Bootstrap
in version 3, but removed in 5.
But, we can easily reproduce one using Bootstrap5
. All we need is to change the bg-color
, text-color
and padding
. Additionally you can add a border-radius
or
box-shadow
. Like this:
They are quite like the alert boxes
but they are for different purposes.
The badges after the headings
So do you want to add some tags for your article after their headings? You can use the badges powered by Bootstrap
. I don't mean ,
but little tag like things.
Some normal ones first...
Those tag like badges are built with class badge
and bg-secondary
. Quite interesting because the badges will automatically fit its height with the headings, so it won't seem weird or too small.
Want some personality?
Try those styles!Bored with those grey, square badges? Maybe you should try styling them with other classes. For example:
Well I used two badges in the last combination!
Bootstrap Cards, Placeholders and loaders
Basic usage of them
Interested in the name card above? That is achieved using Card
. It looks like a mini window. It can be used for conveying additional info.
The glowing stripes are placeholders. Read the code for basic usage!
Can I reproduce a spinner without Bootstrap?
Yes, you definitely can! I looked through Bootstrap
's code and I found it very easy. It's just a bordered span
with border-radius
and sometimes color. At last,
just remember to give it an animation!
Read the code for step-by-step tutorial!
Alert boxes(that you can really close!)
Sometimes after users click on some buttons or checkboxes, there will be an message box. That is achieved by using alert boxes
. Alert boxes are quite like Jumbotrons
, but normally alert boxes are much smaller. They convey different kinds of info.
Alert boxes created manually
You can pre-difine some alert boxes with pure HTML
. They will be shown on the correct places(use the position: static | absolute | fixed | relative | sticky;
attributes) after the page is loaded.
Generate one on the fly!
Want to add a new alert to the page after some events? Then create alerts via JavaScript
is the best solution. You just need to create an element with the correct contents. Try this button below:
The random alert box function is built with Math.random() * 3
. Give it a correct parameter for the range.
You can apply those code to your own site. Amazing, right?