Please consider adding a provision to override the BootStrap Navbar color defaults to the Navbar Style panel (see my attachment).
And a other image showing the same solution, but with a wider shot, you can change the navbar with one click! Here I changed it in red and it works for all sizes. (as long as you don’t start fiddling with the html).
Want a custom style? Just use for example my-navbar instead of bg-warning and:
.my-navbar { background: orange; }
Like in the post of @billybob
I set my navbar background color by using in-line styles since this is the only instance I’ll need this to happen:
Was this the correct method to follow?
Whatever works I think mate. As a final check I always run my launched page through the W3C Validator: https://validator.w3.org/
I agree with @billybob - if it works, go with it.
The cons on inline are things like page bloat and non-reusability.
If you aren’t already loading a custom stylesheet it will take more bandwidth to move that rule to a file all by itself. If you do have a custom sheet, then I would move it. Note: Bootstrap 4 has a class for padding of zero - .p-0
, so you could eliminate that from your inline if desired
If this is the only page with that navbar, you don’t have to worry about re-usability or design unity across pages, otherwise I would add it to a sheet that is loaded on every page.