Re: [css-d] what does "!important" mean?

2012-04-19 Thread David Thorp
Really?  No one knows?

I tried googling it and seeking it out on w3schools, but can't seem to find the 
!important thing specifically.  Just finds lots of (unhelpful) instances of the 
word "important".  (Search engines ignore punctuation supposedly).

David


On 18/04/2012, at 6:03 AM, David Thorp wrote:

> Greetings all...
> 
> Every now and then, when I'm reading other peoples'/companies' css code, i 
> see this "!important" thing added to the end of some of the lines in css.
> 
> What does it do/change?  
> 
> Thanks!
> David.
__
css-discuss [css-d@lists.css-discuss.org]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
List policies -- http://css-discuss.org/policies.html
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/


Re: [css-d] what does "!important" mean?

2012-04-19 Thread Philippe Wittenbergh

On Apr 19, 2012, at 4:39 PM, David Thorp wrote:

> Really?  No one knows?

Or is it that people have been busy today and haven't had time to respond ?

> I tried googling it and seeking it out on w3schools, but can't seem to find 
> the !important thing specifically.  Just finds lots of (unhelpful) instances 
> of the word "important".  (Search engines ignore punctuation supposedly).

Seeking out W3Schools is never a really good idea. they are more wrong then 
right…


Anyway, to answer your question…
!important is specified here:


Philippe
--
Philippe Wittenbergh
http://l-c-n.com/






__
css-discuss [css-d@lists.css-discuss.org]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
List policies -- http://css-discuss.org/policies.html
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/


Re: [css-d] what does "!important" mean?

2012-04-19 Thread Barney Carroll
> > Every now and then, when I'm reading other peoples'/companies' css code,
> i see this "!important" thing added to the end of some of the lines in css.
> >
> > What does it do/change?
>

Hiya David,

The !important flag, when appended to a CSS property, makes the declaration
take precedence over all property declarations without it.

The W3 specification:
http://www.w3.org/TR/CSS21/cascade.html#important-rules

As an aside, w3schools, despite googling well, is a very vague and
sometimes plain wrong resource. I generally include the string 'mdn


-- 
Regards,
Barney

+44 7429177278
__
css-discuss [css-d@lists.css-discuss.org]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
List policies -- http://css-discuss.org/policies.html
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/


Re: [css-d] what does "!important" mean?

2012-04-19 Thread Paceaux
To follow up with what others have shared regarding !important, one of the 
major reasons you see "!important" in these major corporate websites is 
Internet Explorer. Internet Explorer 7 will ignore !important, while other 
browsers will not. So often, the "all other browsers" property is used with 
!important, and the IE property is not. 

Another reason - which I've never been okay with, is website content management 
systems. Many WCMS have rich text editors that allow a content author to style 
content. The CSS author uses !important to prevent those styles from making it 
into the published website. 

In modern browsers, though, !important still overrides your cascade. Outside of 
using it as an IE hack, I recommend avoiding it at all costs as it can really 
lead to the start of a bad day. 

smashing Magazine has a solid article on the subject, too: 
http://coding.smashingmagazine.com/2010/11/02/the-important-css-declaration-how-and-when-to-use-it/



   Frank M Taylor 
   http://frankmtaylor.com
   @paceaux


On Apr 19, 2012, at 1:39 AM, David Thorp wrote:

> Really?  No one knows?
> 
> I tried googling it and seeking it out on w3schools, but can't seem to find 
> the !important thing specifically.  Just finds lots of (unhelpful) instances 
> of the word "important".  (Search engines ignore punctuation supposedly).
> 
> David
> 
> 
> On 18/04/2012, at 6:03 AM, David Thorp wrote:
> 
>> Greetings all...
>> 
>> Every now and then, when I'm reading other peoples'/companies' css code, i 
>> see this "!important" thing added to the end of some of the lines in css.
>> 
>> What does it do/change?  
>> 
>> Thanks!
>> David.
> __
> css-discuss [css-d@lists.css-discuss.org]
> http://www.css-discuss.org/mailman/listinfo/css-d
> List wiki/FAQ -- http://css-discuss.incutio.com/
> List policies -- http://css-discuss.org/policies.html
> Supported by evolt.org -- http://www.evolt.org/help_support_evolt/

__
css-discuss [css-d@lists.css-discuss.org]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
List policies -- http://css-discuss.org/policies.html
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/


Re: [css-d] what does "!important" mean?

2012-04-19 Thread Jukka K. Korpela

2012-04-19 16:12, Paceaux wrote:


one of the major reasons you see "!important" in these major corporate websites 
is Internet Explorer.
Internet Explorer 7 will ignore !important,


No, it does not. It has some bugs in its support, but it would be all 
wrong to say that IE 7 ignores !important.


This discussion should really never have started, as it is very easy to 
check from CSS specifications or tutorials what !important means. To 
fully understand its meaning, you need to understand the cascade in CSS, 
which is not a trivial thing at all - but the role of !important in it 
is well-defined.


On the practical side, which is what we should be discussing in this 
list, !important is often used just to give a CSS rule more "power" in a 
context where different rules apply to an element. As a rule of thumb, 
!important should be avoided because it is so powerful. Instead, more 
specific selectors should be used.


Yucca
__
css-discuss [css-d@lists.css-discuss.org]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
List policies -- http://css-discuss.org/policies.html
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/


Re: [css-d] what does "!important" mean?

2012-04-20 Thread David Thorp
Thanks everyone for the responses, (including a couple of private ones) 
particularly those pointing me to useful articles etc.

I'm now enlightened. ;)

Much appreciated.

Cheers,
David.
__
css-discuss [css-d@lists.css-discuss.org]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
List policies -- http://css-discuss.org/policies.html
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/