What is the class name used in bootstrap to change the background color of a navbar?
Question: What is the class name used in bootstrap to change the background color of a navbar?
The class name used in Bootstrap to change the background color of a navbar is .bg-*. The * can be replaced by any of the following: primary, secondary, success, danger, warning, info, light and dark.
The .bg-* class sets the background color of an element. It can be applied to any element, but it is commonly used in conjunction with the navbar class to change the background color of the navigation bar.
For example, if you want to change the background color of the navbar to primary color you will use .bg-primary class.
By using this class, developers can easily change the background color of the navbar without having to write custom CSS. This can save time and make it easier to maintain a consistent design throughout a website or application.
It's important to notice that this class only changes the background color of an element, if you want to change the color of text you can use classes like .text-primary
Additionally, Bootstrap also provide a set of utility classes .navbar-* to change the color of the navbar, you can use .navbar-light or .navbar-dark to change the color of the text and background, these classes will set text color and background color according to the light or dark theme.
0 Komentar
Post a Comment