Skip to main content
Active reading [<http://en.wikipedia.org/wiki/WordPress>].
Source Link
Peter Mortensen
  • 31.2k
  • 22
  • 111
  • 134

I am planning to use !important!important for a third party-party widget meant to be embedded inin a large number of websites out of my control. 

I reached the conclusion !important!important is the only solution to protect the widget's stylesheet from the host stylesheet (apart from iframe and inline styles, which are equally bad). For instance, WordpressWordPress uses  :

#left-area ul  {
    list-style-type: disc;
    padding: 0 0 23px 16px;
    line-height: 26px;
}

This rule threathens to override any UL in my widget because id's have strong specificity. In that case, systematic use of !important!important seems to be one of the few solutions.

I am planning to use !important for a third party widget meant to be embedded in a large number of websites out of my control. I reached the conclusion !important is the only solution to protect the widget's stylesheet from the host stylesheet (apart from iframe and inline styles, which are equally bad). For instance, Wordpress uses  :

#left-area ul  {
list-style-type: disc;
padding: 0 0 23px 16px;
line-height: 26px;
}

This rule threathens to override any UL in my widget because id's have strong specificity. In that case, systematic use of !important seems to be one of the few solutions.

I am planning to use !important for a third-party widget meant to be embedded in a large number of websites out of my control. 

I reached the conclusion !important is the only solution to protect the widget's stylesheet from the host stylesheet (apart from iframe and inline styles, which are equally bad). For instance, WordPress uses:

#left-area ul {
    list-style-type: disc;
    padding: 0 0 23px 16px;
    line-height: 26px;
}

This rule threathens to override any UL in my widget because id's have strong specificity. In that case, systematic use of !important seems to be one of the few solutions.

Source Link

I am planning to use !important for a third party widget meant to be embedded in a large number of websites out of my control. I reached the conclusion !important is the only solution to protect the widget's stylesheet from the host stylesheet (apart from iframe and inline styles, which are equally bad). For instance, Wordpress uses :

#left-area ul  {
list-style-type: disc;
padding: 0 0 23px 16px;
line-height: 26px;
}

This rule threathens to override any UL in my widget because id's have strong specificity. In that case, systematic use of !important seems to be one of the few solutions.