Utilizing only HTML and CSS, we can achieve the functionality of displaying and hiding content using an anchor tag:
#red { background: red; }
#blue { background: blue; }
#green { background: green; }
.box {
width: 200px;
height: 200px;
display: none;
}
.box:target {
display: block;
}
<a href="#red">Red item</a> | <a href="#blue">Blue item</a> | <a href="#green">Green item</a>
<div class="box" id="red"></div>
<div class="box" id="blue"></div>
<div class="box" id="green"></div>
To automatically display the first item (red) during page load, additional styling or scripting may be required.