{"id":54947,"date":"2019-05-17T18:54:01","date_gmt":"2019-05-17T16:54:01","guid":{"rendered":"https:\/\/samuelchopard.ch\/wiki\/?p=54947"},"modified":"2019-05-17T18:54:01","modified_gmt":"2019-05-17T16:54:01","slug":"how-to-override-important","status":"publish","type":"post","link":"https:\/\/samuelchopard.ch\/wiki\/library\/how-to-override-important\/","title":{"rendered":"How to override !important"},"content":{"rendered":"<p><!--more--><\/p>\n<p>Add another CSS rule with <strong>!important<\/strong>, and either give the selector a higher specificity (adding a tag, id or class to the selector), or add a CSS rule with the same selector at a later point than the existing one. This works because in a specificity tie, the last rule defined wins.<\/p>\n<p>Another way is to identify the element with an additional selector (which comes <em>before<\/em> on the page the actual selector).<\/p>\n<p>Source: <a target=\"_blank\" href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/CSS\/Specificity\">https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/CSS\/Specificity<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"Add another CSS rule with !important, and either give the selector a higher specificity (adding a tag, id or class [...]","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[13,204],"class_list":["post-54947","post","type-post","status-publish","format-standard","hentry","category-htmlcss","tag-important","tag-override"],"_links":{"self":[{"href":"https:\/\/samuelchopard.ch\/wiki\/wp-json\/wp\/v2\/posts\/54947","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/samuelchopard.ch\/wiki\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/samuelchopard.ch\/wiki\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/samuelchopard.ch\/wiki\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/samuelchopard.ch\/wiki\/wp-json\/wp\/v2\/comments?post=54947"}],"version-history":[{"count":1,"href":"https:\/\/samuelchopard.ch\/wiki\/wp-json\/wp\/v2\/posts\/54947\/revisions"}],"predecessor-version":[{"id":54948,"href":"https:\/\/samuelchopard.ch\/wiki\/wp-json\/wp\/v2\/posts\/54947\/revisions\/54948"}],"wp:attachment":[{"href":"https:\/\/samuelchopard.ch\/wiki\/wp-json\/wp\/v2\/media?parent=54947"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/samuelchopard.ch\/wiki\/wp-json\/wp\/v2\/categories?post=54947"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/samuelchopard.ch\/wiki\/wp-json\/wp\/v2\/tags?post=54947"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}