Uh... you realize that !important has no function in IE6, right? And
that it doesn't retain the same functionality in IE7? It's also an
extreme misuse of the tool. This is the situation !important was
designed for:

.tab_link {
width: 35px;
height: 20px;
color: white;
background: black;
cursor: pointer;
}

<div class="tab_link">Click me!</div>

Now, lets say I want to disable the tab. I can do so easily by
applying a single class with the important rule:

<div class="tab_link disable">Click me!</div>

.disable {
opacity: 0.3;
filter: alpha(opacity=0.3);
cursor: none !important;
}

The method I showed there is the right style of usage for the !
important keyword. Your method is, in essence, only further
complicating your code. By throwing !important's everywhere, you're
not only increasing the size of the css files (which is the opposite
of the goal for net scripts/stylesheets), you're also making them
neigh unmaintainable.

The solution to many of your css nightmares is spending the extra hour
to go through and properly design/class your html instead of some
cheap hack.

On Jan 19, 10:55 am, "ryan.joyce...@googlemail.com"
<ryan.joyce...@googlemail.com> wrote:
> but unless you've declared some of your default styles as !important,
> the widget *will* take precedence if it's called after the default
> CSS.
>
> the only issues i can see are relative vs. explicit pixel sizes - for
> ex. if you've declared pixel sizes for your fonts with some especially
> broad selectors (globally stating that all paragraphs in divs have a
> font size of 10px or whatever)  whilst the widget author has used
> relative % sizes. Even in those cases it's be quicker, easier and
> neater to just change your default CSS rather than replacing every
> instance of ; with !important; in your imported stylesheet.
>
> the long and the short of it it that it's a very inelegant solution to
> a problem that isn't so much a 'problem' as 'the whole point of
> cascading stylesheets'. it's like looking for a solution to grass
> being green!
>
> On Jan 19, 3:32 pm, johny why <johny...@gmail.com> wrote:
>
> > i don't see it as a problem. With or without !important, the site-css
> > will cascade into the widget for elements undeclared in the widget--
> > the widget designer expects that. The important thing is for the
> > widget's declared styles to take precedence, which !important achieves
> > in most cases. (if i'm integrating the jQuery widget into a cms like,
> > say, WordPress, i may or may not have control over exactly when the
> > widget-css is declared.)

Reply via email to