To me, 'important' is the 'goto' of CSS.

On Jan 20, 6:22 am, "ryan.joyce...@googlemail.com"
<ryan.joyce...@googlemail.com> wrote:
> > --rendering problems of a widget, in my experience, could involve
> > many, indeed EVERY attribute of every element in the widget.
>
> you declare your default stylesheet, then you declare your widget's
> sheet. if the widget is inheriting incorrectly from a parent element
> you've got a couple of ways around it. making every single line of the
> widget's CSS !important is probably the longest (not in terms of a
> find replace in n++, rather in terms of physical size). a nicer change
> would just be to give the widget's parent element an appropriate
> attribute val to reign in the -999px left-margin you originally gave
> it.
>
> > --this solution is for cases where changing your default css, which
> > will of course affect your main site rendering, is undesirable or
> > impossible. for me, doing a global replace of ";" with " !important;"
> > takes about 1/2 a second. on the other hand, fine-tuning my main site
> > css so that the widget and the site both look right could potentially
> > take hours of trouble-shooting, trial-and-error, and juggling
> > precedence, including specificity, order of declaration, id's and
> > classes, and so on.
>
> the inheritance path really isn't that complicated, and if your
> stylesheet to that complex you don't fully understand it, inspecting
> an element in firebug to see where it's getting it's style from takes
> a couple of seconds. it's an ugly hack that has so many potential
> problems it's barely worth considering for anything but the simplest
> widget, and at that point why not just fix the widget's CSS properly.
>
> > !important does not 'break' css-- it's part of the css language,
> > intended to be used where appropriate.
>
> the last part of that sentence is the important bit! ;)

Reply via email to