0

Sorry if this is a silly question, I'm completely new to bootstrap and ASP.NET.

I'd really like to change the nav-link colours for my web application but applying inline CSS and changing the bootstrap.css is not working. According to inspect all CSS for the nav-links are being overridden by Navbar.less

Screenshot of inspect:
Screenshot of inspect

Bootstrap v3.4.1

Zach Jensz
  • 3,650
  • 5
  • 15
  • 30
Vixxy
  • 3
  • 2

1 Answers1

0

Of course you should be compiling bootstrap's files combined with your style to make a perfect match, taking advantage of bootstrap variables, and overriding them in case of need. You can compile it automatically when saving using editor extension or other way you choose.

I assume you are using bootstrap 3 because it uses less files.

main.less <-- your file

@import "path/to/bootstrap.less";

// your overrides here: (see file variables.less)
@navbar-default-color:             white;
@navbar-default-bg:                pink;

// and also
.my-primary-border {
  border: 1px solid @brand-primary;
}

// and rest of your styles.

my-html.html

<!-- main.css is automatic output of main.less -->
<link rel="stylesheet" href="main.css">

If you're using bootstrap 4/5 it's the same idea. See here

IT goldman
  • 14,885
  • 2
  • 14
  • 28