- Description
Gives a style value a higher weight in the cascade order. Values with higher weight or importance in the order of cascade win out against lower weighted styles when conficts occur.
!important allows users to override or have their own rules be more specific then the authors rules.
You should avoid using !important in as much as possible in your author stylesheets. They make reading and debugging your styles harder.The order of importance of rules in stylesheets in ascending order.
- User Agent stylesheets. (least specific)
- User stylesheets.
- Author stylesheets.
- Author stylesheets with !important.
- User stylesheets with !important. (most specific)
The most interesting of that list is the User Styles with !important, it has the power to outweigh all others. That gives users with specific needs the ability to make the changes they require.
- Live Example
- Play with the code in the textarea below.
- Values
- none
- Introduced in CSS version
- 1
- Applies to elements
- All
- Inherited
- No
- Browser Support
Browsers IE Firefox Safari Opera Chrome Versions full 7, part 5 1 1 6 0.2
Belongs to:
See the full list CSS properties and browser support: CSS Properties