importance

importance

When we do website code, some special cases to have the highest weight value to some styles, how to do? This time we can use ! Important to resolve.

The following code:

{Color the p-: Red Important;!} 
the p-{Color: Green;} 
< the p- class = "First" > third grade, I was a < span > timid </ span > little girl. </ P >

Then p red text in the paragraph will be displayed in red.

Note:! Important to write in front of the semicolon

Note here that when a Web page creator css style is not set, the browser will follow their own set of style to display pages. And the user can also set the browser own custom styles, such as some users are accustomed to set the font size larger, so that it more clearly view the page's text. Then pay attention to style priority: Browser default style <web authors style <style user's own settings , but keep in mind important priority pattern is an exception, the right value is higher than the user's own set of style!.

Guess you like

Origin www.cnblogs.com/iBoundary/p/11432187.html