JSFiddle - React, Tailwind, and code Playground
HTML
<a href="#target-1">click-to-target-1</a>
<a href="#target-2">click-to-target-2</a>
<div id="target-1"> tagert-1 </div>
<div id="target-2"> target-2 </div>
CSS
div[id]{
display: block;
width: 100px;
height: 100px;
text-align: center;
line-height: 100px;
border-radius: 50%;
margin: 10px;
background: rgb( 0, 180, 255);
}
div:target {
background: rgb( 255, 90, 180);
}
}