{"id":91,"date":"2022-01-11T20:16:52","date_gmt":"2022-01-11T20:16:52","guid":{"rendered":"https:\/\/melfaeforest.xhere.eu.org\/?p=91"},"modified":"2022-02-02T21:42:26","modified_gmt":"2022-02-02T21:42:26","slug":"html-css-course-day-5-conflicts-between-selectors","status":"publish","type":"post","link":"https:\/\/melfaeforest.xhere.eu.org\/?p=91","title":{"rendered":"HTML\/CSS Course \u2013 Day 5 \u2013 Conflicts Between Selectors"},"content":{"rendered":"\n<p>In CSS, it is possible to have multiple selectors and declarations applying to elements of CSS styling, but what happens if there are conflicting styling selections? Simple: There\u2019s a priority in what conflicting styling is applied. The priority list goes as follows from highest priority to lowest:<\/p>\n\n\n\n<p>5) Declaration marked \u201c!important\u201d \u2013 These go after a declaration \/ style in the declaration block, such as \u201ccolor: green !important;\u201d for example. This is almost never used, as that usually means you should simplify the IDs and Classes of targeted tags and elements with declarations \/ styles.<\/p>\n\n\n\n<p>4) Inline style \u2013 Style attributes inside HTML directly. Again, almost never used since there are better and more readable alternatives to styling HTML.<\/p>\n\n\n\n<p>3) ID (#) selector<\/p>\n\n\n\n<p>2) Class ( . ) or pseudo-class ( : ) selector<\/p>\n\n\n\n<p>1) Element selector (p, div, li, etc.)<\/p>\n\n\n\n<p>0) Universal selector<\/p>\n\n\n\n<p>For ID, Class\/Pseudo-Class, and Element selectors, if there are multiple conflicting styles in those selectors, then the last selector in the CSS code is applied.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In CSS, it is possible to have multiple selectors and declarations applying to elements of CSS styling, but what happens if there are conflicting styling selections? Simple: There\u2019s a priority in what conflicting styling is applied. The priority list goes as follows from highest priority to lowest: 5) Declaration marked \u201c!important\u201d \u2013 These go after [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[6],"class_list":["post-91","post","type-post","status-publish","format-standard","hentry","category-html-css-course","tag-html-css-course"],"_links":{"self":[{"href":"https:\/\/melfaeforest.xhere.eu.org\/index.php?rest_route=\/wp\/v2\/posts\/91","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/melfaeforest.xhere.eu.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/melfaeforest.xhere.eu.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/melfaeforest.xhere.eu.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/melfaeforest.xhere.eu.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=91"}],"version-history":[{"count":2,"href":"https:\/\/melfaeforest.xhere.eu.org\/index.php?rest_route=\/wp\/v2\/posts\/91\/revisions"}],"predecessor-version":[{"id":287,"href":"https:\/\/melfaeforest.xhere.eu.org\/index.php?rest_route=\/wp\/v2\/posts\/91\/revisions\/287"}],"wp:attachment":[{"href":"https:\/\/melfaeforest.xhere.eu.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=91"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/melfaeforest.xhere.eu.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=91"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/melfaeforest.xhere.eu.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=91"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}