I have this code:
CSS:
.tab div {
display: none;
}
.tab div:target {
display: block;
position: absolute;
top: 20px;
z-index: 999;
}
.c {
position: absolute;
top: 30px;
width: 20px;
height: 20px;
background: yellow;
z-index: 1;
}
BODY:
<div class="tab">
<a href="#link1">Link 1</a>
<a href="#link2">Link 2</a>
<a href="#link3">Link 3</a>
<div id="link1">
<h3>Content to Link 1</h3>
<p>Hello World!</p>
</div>
<div id="link2">
<h3>Content to Link 2</h3>
<h4>Great success!</h4>
</div>
<div id="link3">
<h3>Content to Link 3</h3>
<p>Yeah!</p>
</div>
<div class="c" style="display:block"></div>
</div>
https://jsfiddle.net/z9v4py3c/
I am thinking is there an any way: when I click on "a element", div with "c" class disappear. I tried a lot of options, but I am not a CSS expert. In this code "input element" cannot appear or JavaScript. I will be very thankful for help.