I’m afraid that I couldn’t work out in your sample code and image what you wanted to click and what you wanted to show. However, the following works with an onclick-like event with pure CSS:
<div id="wrapper">
<ul id="top">
<li><a href="#one">One</a></li>
<li><a href="#two">Two</a></li>
</ul>
<div class="box" id="one">
<p>One</p>
<span><a href="#top">Close</a></span>
</div>
<div class="box" id="two">
<p>Two</p>
<span><a href="#top">Close</a></span>
</div>
</div>
CSS
.box {
position: absolute;
top: 20%;
left: 50%;
width: 50%;
margin-left: -25%;
border: 4px solid #000;
background-color: #f90;
/* the CSS, above, is all for aesthetic purposes, what matters is the following */
opacity: 0;
-webkit-transition: all 1s linear;
-ms-transition: all 1s linear;
-moz-transition: all 1s linear;
-0-transition: all 1s linear;
transition: all 1s linear;
}
.box:target {
opacity: 1;
-webkit-transition: all 1s linear;
-ms-transition: all 1s linear;
-moz-transition: all 1s linear;
-0-transition: all 1s linear;
transition: all 1s linear;
}
JS Fiddle demo.
, ( Chromium 17/Ubuntu 11.04) display: none; display: block; , height: 0 height: auto ( , , "", ( ), , .
:
.box {
/* aesthetic stuff excised for brevity */
opacity: 0;
height: 0;
overflow: hidden;
-webkit-transition: all 1s linear;
-ms-transition: all 1s linear;
-moz-transition: all 1s linear;
-0-transition: all 1s linear;
transition: all 1s linear;
}
.box:target {
opacity: 1;
height: 3em;
-webkit-transition: all 1s linear;
-ms-transition: all 1s linear;
-moz-transition: all 1s linear;
-0-transition: all 1s linear;
transition: all 1s linear;
}
JS Fiddle demo.