When you click on the anchor tag "Click me," is there a way to use only CSS to display the p
tag with the text "This is my answer"? I am aware that placing the p
tag after the anchor
tag is a solution, but I am curious if there is a method to achieve this with the code provided below.
<ul>
<li>
<div>
<a href="one" id="one"> Click me </a>
</div>
</li>
<div class="info">
<p> This is my answer </p>
</div>
</ul>
li {
list-style: none;
}
.info {
display:none;
}
.info:target {
display:block;
}