So I have a problem with my hiding/showing of DIVs without the use of JavaScript.
So basically, the moment you click on a link within the div that has been selected, the div will close and you won't be taken to that link.
The code is below. I am not using JavaScript for this so please don't give me that as a solution/suggestion. I am using Chrome, however I have tested with other browsers and it is a problem within them as well.
I've just filled it with some test data, but it functions exactly the same as with the live data. Just click on the heading, and try to click on the 'Google' link and you'll understand my problem.
If anyone can fix it, that would be great because I can't seem to do it. :/
<html>
<head>
<style>
.collapse > * + *{
display:none;
}
.collapse > *{
cursor:pointer;
}
.collapse:focus{
outline:none;
}
.collapse:focus > * + *{
display:block;
}
.collapse h1 {
background-color:#BF3131;
}
</style>
</head>
<body>
<div class="collapse" tabindex="1">
<h1 id="test">LOREM IPSUM</h1>
<p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat</p>
<p><a href="http://www.google.com">Google</a>
</div>
<div class="collapse" tabindex="1">
<h1 id="lol">Test</h1>
<p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat</p>
<p><a href="http://www.google.com">Google</a>
</div>
</body>
</html>
This was originally from : Show hide divs on click in HTML and CSS without jQuery