Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change the default background color white to something else in twitter bootstrap

I am building a web application where I have set my default color to navy blue using css. But when i added the twitter bootstrap css's in my page I did not find my navy blue color instead I found the white background color provided by twitter bootstrap.

My query is that what portion of css should I change in bootstrap to change my page's background.

like image 354
SM Farhad Ali Avatar asked May 26 '12 18:05

SM Farhad Ali


People also ask

How do I change my main background color?

Select Start > Settings > Personalization > Colors, and then choose your own color, or let Windows pull an accent color from your background.

Which bootstrap class will you use to give primary color to a paragraph?

The classes for background colors are: . bg-primary , . bg-success , . bg-info , .


2 Answers

You can overwrite Bootstraps default CSS by adding your own rules.

<style type="text/css">    body { background: navy !important; } /* Adding !important forces the browser to overwrite the default style applied by Bootstrap */ </style> 
like image 55
Jako Avatar answered Sep 23 '22 05:09

Jako


Bootstrap 4 provides standard methods for this, fully described here: https://getbootstrap.com/docs/4.3/getting-started/theming

Eg. you can override defaults simply by setting variables in the SASS file, where you import bootstrap. An example from the docs (which also answers the question):

// Your variable overrides $body-bg: #000; $body-color: #111;  // Bootstrap and its default variables @import "../node_modules/bootstrap/scss/bootstrap"; 
like image 32
Zoltan Peller Avatar answered Sep 24 '22 05:09

Zoltan Peller