Skip to main content

Posts

Showing posts with the label Important Statement

!important Statement in CSS

As the name indicates it’s an important statement in CSS. From interview point of view too it’s commonly asked question even from the back end programmers. If you will search in google about the !important statement you will find a list of pages. I am writing about it to include everything possible under this topic and to keep it in my mind for times. What is !important Statement? The !important statement is actually a keyword you can use at the end of CSS property. It would give more importance to that statement. For example : p {margin-left: 10px !important} How it works? Normally what happened, when you have two statements with same property and different values then as per the CSS rules, recent one would be used. For example : p{margin-left : 10px} p{margin-left : 20px} in this case 2 nd one would be used. But when you use !important statement as following : p {margin-left: 10px !important} p{margin-left : 20px} then the first one wi...