While working on creating page numbers, I stumbled upon this intriguing CodePen: https://codepen.io/p-ziegler/pen/bmdaaN
.b,
input[type="radio"] {
display: inline-block;
width: 16px;
height: 16px;
vertical-align: middle;
}
.b {
background-color: gray;
text-align: center;
color: white;
}
input[type="radio"] {
opacity: 0.01;
margin-left: -16px;
cursor: pointer;
}
.p {
display: none;
}
#p1:checked ~ .p1,
#p2:checked ~ .p2,
#p3:checked ~ .p3 {
display: block;
}
<div>
<div class="b">1</div><input type="radio" name="p" id="p1" checked>
<div class="b">2</div><input type="radio" name="p" id="p2">
<div class="b">3</div><input type="radio" name="p" id="p3">
<div class="p p1">Page 1</div>
<div class="p p2">Page 2</div>
<div class="p p3">Page 3</div>
</div>
One notable aspect is that Javascript isn't necessary for this. However, I encountered a problem when attempting to relocate the page numbers to the bottom below the content while placing the content above the number set. Upon making this change, all the contents vanished. Any guidance on how to resolve this issue would be greatly appreciated.