Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

How do i change individual border colors in bootstrap 5?

<div class="m-3 p-3 border-5 border-top border-danger border-bottom border-primary">
  Border with different colors?
</div>

Is there a way to accomplish this maybe using sass?

>Solution :

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

Yes in SCSS you should use BOM approch so you can write like this:

<div class="border border-top border-bottom">

Border with different colors?

Now scss:

.border {
&-bottom {
border-bottom-color: red
}
&-top {
border-top-color: green
}
}

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading