Skip to main content

Posts

Showing posts with the label CSS

Importance of !important in CSS

Do you know What does !important mean in CSS?, an "!important" declaration (the keywords "!" and "important" follow the declaration) this takes high precedence over a normal declaration. And can be framed in this way, this means that the styles are applied in order as they are read by the browser. CSS it tries to create a balance of power between author and user style sheets. By default, rules in an author's style sheet override those in a user's style sheet. But in CSS1, this is in other way round - Author "!important" rules took precedence over User "!important" rules. For Example: User's Style Sheet: 1: < style > 2: p { font-size : 2em !important; } 3: p { font-style : italic; } 4: < / style > Author's Style Sheet: 1: < style > 2: p { font-size : 3em; } 3: p { font-style : normal; } 4: < / style > If you see in the above i...