Skip to content

Instantly share code, notes, and snippets.

@rahuls360
Created September 23, 2019 07:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rahuls360/bfe99bc1bc4768d8c81d464812724488 to your computer and use it in GitHub Desktop.
Save rahuls360/bfe99bc1bc4768d8c81d464812724488 to your computer and use it in GitHub Desktop.
Add bootstrap 4 margin and padding utility classes
/* Margin */
/* Margin Top */
.mt-0{
margin-top: 0px !important;
}
.mt-1{
margin-top: 0.25rem !important;
}
.mt-2{
margin-top: 0.5rem !important;
}
.mt-3{
margin-top: 1rem !important;
}
.mt-4{
margin-top: 1.5rem !important;
}
.mt-5{
margin-top: 3rem !important;
}
/* Margin Bottom */
.mb-0{
margin-bottom: 0px !important;
}
.mb-1{
margin-bottom: 0.25rem !important;
}
.mb-2{
margin-bottom: 0.5rem !important;
}
.mb-3{
margin-bottom: 1rem !important;
}
.mb-4{
margin-bottom: 1.5rem !important;
}
.mb-5{
margin-bottom: 3rem !important;
}
/* Margin Left */
.ml-0{
margin-left: 0px !important;
}
.ml-1{
margin-left: 0.25rem !important;
}
.ml-2{
margin-left: 0.5rem !important;
}
.ml-3{
margin-left: 1rem !important;
}
.ml-4{
margin-left: 1.5rem !important;
}
.ml-5{
margin-left: 3rem !important;
}
/* Margin Right */
.mr-0{
margin-right: 0px !important;
}
.mr-1{
margin-right: 0.25rem !important;
}
.mr-2{
margin-right: 0.5rem !important;
}
.mr-3{
margin-right: 1rem !important;
}
.mr-4{
margin-right: 1.5rem !important;
}
.mr-5{
margin-right: 3rem !important;
}
/* Margin Xaxis */
.mx-0{
margin-right: 0px !important;
margin-left: 0px !important;
}
.mx-1{
margin-right: 0.25rem !important;
margin-left: 0.25rem !important;
}
.mx-2{
margin-right: 0.5rem !important;
margin-left: 0.5rem !important;
}
.mx-3{
margin-right: 1rem !important;
margin-left: 1rem !important;
}
.mx-4{
margin-right: 1.5rem !important;
margin-left: 1.5rem !important;
}
.mx-5{
margin-right: 3rem !important;
margin-left: 3rem !important;
}
/* Margin Yaxis */
.my-0{
margin-top: 0px !important;
margin-bottom: 0px !important;
}
.my-1{
margin-top: 0.25rem !important;
margin-bottom: 0.25rem !important;
}
.my-2{
margin-top: 0.5rem !important;
margin-bottom: 0.5rem !important;
}
.my-3{
margin-top: 1rem !important;
margin-bottom: 1rem !important;
}
.my-4{
margin-top: 1.5rem !important;
margin-bottom: 1.5rem !important;
}
.my-5{
margin-top: 3rem !important;
margin-bottom: 3rem !important;
}
/* Padding */
/* Padding Top */
.pt-0{
padding-top: 0px !important;
}
.pt-1{
padding-top: 0.25rem !important;
}
.pt-2{
padding-top: 0.5rem !important;
}
.pt-3{
padding-top: 1rem !important;
}
.pt-4{
padding-top: 1.5rem !important;
}
.pt-5{
padding-top: 3rem !important;
}
/* Padding Bottom */
.pb-0{
padding-bottom: 0px !important;
}
.pb-1{
padding-bottom: 0.25rem !important;
}
.pb-2{
padding-bottom: 0.5rem !important;
}
.pb-3{
padding-bottom: 1rem !important;
}
.pb-4{
padding-bottom: 1.5rem !important;
}
.pb-5{
padding-bottom: 3rem !important;
}
/* Padding Left */
.pl-0{
padding-left: 0px !important;
}
.pl-1{
padding-left: 0.25rem !important;
}
.pl-2{
padding-left: 0.5rem !important;
}
.pl-3{
padding-left: 1rem !important;
}
.pl-4{
padding-left: 1.5rem !important;
}
.pl-5{
padding-left: 3rem !important;
}
/* Padding Right */
.pr-0{
padding-right: 0px !important;
}
.pr-1{
padding-right: 0.25rem !important;
}
.pr-2{
padding-right: 0.5rem !important;
}
.pr-3{
padding-right: 1rem !important;
}
.pr-4{
padding-right: 1.5rem !important;
}
.pr-5{
padding-right: 3rem !important;
}
/* Padding Xaxis */
.px-0{
padding-right: 0px !important;
padding-left: 0px !important;
}
.px-1{
padding-right: 0.25rem !important;
padding-left: 0.25rem !important;
}
.px-2{
padding-right: 0.5rem !important;
padding-left: 0.5rem !important;
}
.px-3{
padding-right: 1rem !important;
padding-left: 1rem !important;
}
.px-4{
padding-right: 1.5rem !important;
padding-left: 1.5rem !important;
}
.px-5{
padding-right: 3rem !important;
padding-left: 3rem !important;
}
/* Padding Yaxis */
.py-0{
padding-top: 0px !important;
padding-bottom: 0px !important;
}
.py-1{
padding-top: 0.25rem !important;
padding-bottom: 0.25rem !important;
}
.py-2{
padding-top: 0.5rem !important;
padding-bottom: 0.5rem !important;
}
.py-3{
padding-top: 1rem !important;
padding-bottom: 1rem !important;
}
.py-4{
padding-top: 1.5rem !important;
padding-bottom: 1.5rem !important;
}
.py-5{
padding-top: 3rem !important;
padding-bottom: 3rem !important;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment