ndemoreau
ndemoreau

Reputation: 3869

how can I override a css setting set for all selectors

The Bootstrap css file has an @media print section which sets the following css rule:

* {
    color: #000 !important;
    text-shadow: none !important;
    background: transparent !important;
    box-shadow: none !important;
  }

I would like to override the background property to be able to print different kinds of backgrounds in my app.

I need to override to preserve backward compatibility of my bootstrap files of course.

I don't find the way to do it.

Can you help?
Thx!

Upvotes: 0

Views: 114

Answers (1)

LorDex
LorDex

Reputation: 2636

Remove !important clausule from background.

So change it to:

* {
    color: #000 !important;
    text-shadow: none !important;
    background: transparent;
    box-shadow: none !important;
  }

Then add style for body

body {
    background: red;
}

EDIT:

if you dont't want to remove !important from bootstrap, just add !important to you body background - that dhouls override it:

body {
   background: red !important;
}

Upvotes: 2

Related Questions