I am using a jQuery light box plugin on a bootstrap site. It has box-sizing: border-box
set via universal selector.
* { -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box; }
The light box div does not appear right because of this (sometimes a vertical scrollbar appears). Once we remove this through web inspector it appears ok. Is there any way to remove the box-sizing property of this particular element. box-sizing:''
or box-sizing:none
does not appear to work.
One potential gripe with it is that box-sizing isn't normally inherited, so it's specialized behavior, not quite the same as something you'd normally put in a reset.
The box-sizing property defines how the width and height of an element are calculated: should they include padding and borders, or not.
border-box tells the browser to account for any border and padding in the values you specify for an element's width and height. If you set an element's width to 100 pixels, that 100 pixels will include any border or padding you added, and the content box will shrink to absorb that extra width.
With the CSS box-sizing Property The box-sizing property allows us to include the padding and border in an element's total width and height. If you set box-sizing: border-box; on an element, padding and border are included in the width and height: Both divs are the same size now!
The box-sizing
msdn, mdn CSS property default is box-sizing: content-box;
. Have you tried to use it to override the inherited style?
you can use
*:not(.classname){ box-sizing : border-box; }
classname
will be the class of element you want to exclude from the universal selector.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With