Understanding CSS selector priority / specificity

I'd like to understand how CSS selectors work with property collisions. How is one property selected over another one?

div { background-color: red; } div.my_class { background-color: black; } div#my_id { background-color: blue; } body div { background-color: green; } body>div { background-color: orange; } body>div#my_id { background-color: pink; }
hello

How does selector priority work?

34
задан misterManSam 31 October 2019 в 02:05
поделиться