Jump to content

Applying Multiple Styles Html Elements And Significance Of "!important " Attribute In Forcing Styles


eliza81

Recommended Posts

Hi, i am sharing a tip with ypu all.Hope you find this informative:Applying multiple styles HTML elements and significance of "!important " attribute in forcing styles There can be multiple CSS classes and inline style applied to a single html element. By the default CSS rule, if same style attribute is set with different values on top of a single element, the closest attribute value will dominate in the out put at the browser end. !important is a special attribute that can break the rule, and can force a particular style irrespective of the hierarchy of all the styles applied.

Link to comment
Share on other sites

But a good developer knows that if "!important" is in the stylesheet they most likely are misunderstanding selector priorities and there's probably a better way to do it.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...