Title:   !important
Submitted by:
  Mark
Date:
  Wed 26 April, 2006
credits:  
!important
Everyone has had this happen to them - your website looks fine in Firefox, but it is off by one or two pixels in Internet Explorer. Well, there is good news. Usually the CSS will use whatever rule it saw last. Therefore:

li { margin-left: 2px !important; margin-left: 5px; }

The browser would normally use the 5px, but use !important after a command in firefox and it will use that. However, Internet Explorer will not. In firefox, the left margin is 2px, in Internet Explorer, the left margin is 5px. As you can see, fixes might become a little easier now.

 
To get help or discuss this article,
please visit the forums.