I want a user to be able to click on a part of a div, and then the div will expand with the information. Yet I do not want to use PHP or Javascript for this. I found this interesting link: Pure CSS collapse/expand div, and the link: http://jsfiddle.net/eJX8z/. Now I want to do the same thing (as the JSfiddle). Yet my problem is it does not seem to work!
My HTML:
<a href="#hidemore" class="hidemore col-xs-12" id="hidemore">More</a>
<a href="#showmore" class="showmore col-xs-12" id="showmore">Less</a>
<div class="col-xs-2 itemtoshow">
<img src="image.png" id="holderspecs">
</div>
<div class="col-xs-2 itemtoshow">
<img src="image.png" id="holderspecs">
</div>
<div class="col-xs-2 itemtoshow">
<img src="image.png" id="holderspecs">
</div>
My CSS:
.itemtoshow {
display:none;
height:auto;
margin:0;
float: left;
}
.showmore {
display: none;
}
.hidemore:target + .showmore {
display: inline;
}
.hidemore:target {
display: none;
}
.hidemore:target > .itemtoshow{
display:block;
}
.hidemore,
.showmore {
font-size: 150%;
font-weight: bold;
padding: 5px;
text-align: center;
color: #474747;
}
Update:
How would I achieve this with the following HTML?
<a href="#postallionshowmore" class="postallionshowmore col-xs-12" id="postallionshowmore">More</a>
<div class="col-xs-12">
<div class="col-xs-2 postallionitemtoshow">
<img src="http://localhost/postin'/images/defaultprofileimage.png" id="postallionholderspecs">
</div>
<div class="col-xs-2 postallionitemtoshow">
<img src="http://localhost/postin'/images/defaultprofileimage.png" id="postallionholderspecs">
</div>
<div class="col-xs-2 postallionitemtoshow">
<img src="http://localhost/postin'/images/defaultprofileimage.png" id="postallionholderspecs">
</div>
</div>
I tried the ~ Connector again but it did not work. :(