• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Create new color for Navbar background

Participant ,
Aug 05, 2021 Aug 05, 2021

Copy link to clipboard

Copied

A simple thing, you would think. I just want to change the navbar color from dark gray to dark blue. I know I cannot edit Bootstrap so started a new CSS file, but am unable to code it so the navbar color changes with all other elements controlled by bootstrap...

 

www.speedindustrialgas.com

TOPICS
Code , How to

Views

804

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

LEGEND , Aug 05, 2021 Aug 05, 2021
quote

A simple thing, you would think. I just want to change the navbar color from dark gray to dark blue. I know I cannot edit Bootstrap so started a new CSS file, but am unable to code it so the navbar color changes with all other elements controlled by bootstrap...

 

www.speedindustrialgas.com


By @maryanns50585047

 

Currently this is the css selector which sets your navbar background:

 

 

 

.bg-dark {
background-color: #343a40 !important;
}

 

 

 

 

To alter or add css styles when using Bootstrap you need to crea

...

Votes

Translate

Translate
LEGEND ,
Aug 05, 2021 Aug 05, 2021

Copy link to clipboard

Copied

quote

A simple thing, you would think. I just want to change the navbar color from dark gray to dark blue. I know I cannot edit Bootstrap so started a new CSS file, but am unable to code it so the navbar color changes with all other elements controlled by bootstrap...

 

www.speedindustrialgas.com


By @maryanns50585047

 

Currently this is the css selector which sets your navbar background:

 

 

 

.bg-dark {
background-color: #343a40 !important;
}

 

 

 

 

To alter or add css styles when using Bootstrap you need to create a new css stylesheet and link it to the page AFTER the link to the default bootstrap.min.css file. If you do not link your newly created css stylesheet AFTER then the css styles will not take effect

 

Then in your newly attached css stylesheet:

 

Either add the below (and remove the 'bg-dark' class from the navbar)

 

.navbar {
background-color: blue!important; /* or whatever hex value you require */
}

 

OR change the existing selectors color...

 

.bg-dark {
background-color: blue!important; /* or whatever hex value you require */:
}

 

Does any of that make any sense???

 

Whatever you do DO NOT alter the default Bootstrap css file.

 

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Aug 05, 2021 Aug 05, 2021

Copy link to clipboard

Copied

LATEST

It worked!! How can I thanks you?!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 05, 2021 Aug 05, 2021

Copy link to clipboard

Copied

You can change Bootstrap CSS to a Bootswatch Theme.  For Bootstrap 5, there are 26 themes to choose from.

https://bootswatch.com/

 

Nancy O'Shea— Product User, Community Expert & Moderator

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Aug 05, 2021 Aug 05, 2021

Copy link to clipboard

Copied

Wow! A whole new world. Thanks a BUNCH!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines