Reset Style on Inherited Items

I have one <div>, and I don't want to inherit any formatting from other stylesheets. I want to start with this <div>. How can i do this?

+3
source share
5 answers

I know of no solution other than explicitly resetting all styles for this div.

+3
source

you cannot reset css style inheritance. To start with a new one, you must create your own style sheet to prevent unwanted inheritance, this is the only way besides redefining styles.

+2
source

- firebug IE, , div, reset , .

+2

, , , .

, ...

! important ( ).

div.myspecialdiv
{
  padding:10px !important;
  margin:0 auto !important;
  font-size:12px !important;
  font-family:Arial !important;
  font-weight:normal !important;
  /* and etc. */
}

.

:

div.myspecialdiv
{
  padding:auto;
  margin:auto;
  background:auto;
  font-size:auto;
  font-family:auto;
  font-weight:auto;
  /* and etc. */
}

: http://www.michaelhamrah.com/blog/2009/02/wiping-out-inherited-css-styles/

0

, CSS-, <Style>, .

, .RadComboBoxDropDown Input, . , , , css, css .

 <style>
        .RadComboBoxDropDown input
        {
            margin: 0px !important;
        }
 </style>

Chrome, , , .

, css, .

0

Source: https://habr.com/ru/post/1749193/


All Articles