1

I'm using the bootstrap 4.0 minified css on an application site I want to inject over the top of another site.

Here is the file: http://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.0.0-alpha/css/bootstrap.min.css

The issue I'm having is the following styling is affecting the site sitting behind my application because of these styles:

*,
:after,
:before {
    -webkit-box-sizing: inherit;
    box-sizing: inherit;
}

I've tried to modify the CSS so it targets only everything within my wrapping div like so:

.prefix-wrapper * {
        -webkit-box-sizing: inherit;
        box-sizing: inherit;
    }

This didn't work - any ideas?

Filth
  • 3,116
  • 14
  • 51
  • 79

1 Answers1

0

I'm not familiar with Bootstap 4 but the current "thinking" is that the box-sizing 'reset' is formed like so:

html {
  box-sizing: border-box;
}
*, *:before, *:after {
  box-sizing: inherit;
}

So, if you wish to use,

.prefix-wrapper * {
        -webkit-box-sizing: inherit;
        box-sizing: inherit;
    }

...you first have to change the box-sizing property on the parent to something different.

So something like:

.prefix-wrapper {
        -webkit-box-sizing: content-box;
        box-sizing: content-box;
    }

Inheriting box-sizing @ CSS-Tricks

Paulie_D
  • 107,962
  • 13
  • 142
  • 161