3
In the project I am studying/working I am making small adjustments in the native Bootstrap classes to meet my needs.
1: Is this really best practice? Or is it better to create our classes and overwrite the bootstrap ones? Or besides, there is some other usage practice that is better for us to personalize our projects?
For example, below I created a class to modify a native Bootstrap navbar:
.navperson {
box-shadow: 2px 2px 8px rgba(0,0,0,0.5);
color: #ffffff;
border-top: 2px solid #5bc0de;
border-bottom: 2px solid #5bc0de;
}
2: In the . html document, I first need to always link the bootstrap . css and then the custom . css, right? If we apply . bootstrap css after, it will not overwrite the properties of . css custom, sure?
3: The order of application of the classes changes something?
Ex:
<nav class="navbar navbar-expand-md navbar-light navperson">
Or:
<nav class="navperson navbar-light navbar-expand-md navbar">
In this case, there is no better or worse, each person does it in a way. It depends on what you prefer.
– Rafael Augusto
I sincerely like to overwrite the native class, not to have 10 classes in an element, in the end you end up getting kind of lost from which class he is respecting. Dirty the HTML. But like Rafael said, it’s like. I prefer it like this. E on the class order, no. The order is defined in the CSS, by its cascade, no matter the order of the class in the HTML you put.
– Jackson