<div id="ave">
<h2><a href="#ave">Ave verum</a></h2>
<p>Ave verum corpus, natum de Maria Virgine, vere passum, immolatum in cruce pro homine,
cuius latus perforatum unda fluxit et sanguine: esto nobis praegustatum in mortis examine.</p>
</div>
<div id="gaudeamus">
<h2><a href="#gaudeamus">Gaudeamus</a></h2>
<p>Gaudeamus igitur, Juvenes dum sumus!
Post jucundam juventutem, Post molestam senectutem, Nos habebit humus!</p>
</div>
<div id="odi">
<h2><a href="#odi">Odi et amo</a></h2>
<p>Quare id faciam, fortasse requiris. Nescio, sed fieri sentio et excrucior.</p>
</div>
CSS
body {
font-family: "Liberation Sans",sans-serif;
color: #000;
background-color: #fff;
}
h2 {
margin: 0;
padding: 0;
font-size: 111%;
}
div {
background-color: #def;
-moz-transition: background-color 1s;
-ms-transition: background-color 1s;
-o-transition: background-color 1s;
-webkit-transition: background-color 1s;
transition: background-color 1s;
margin: 0;
padding: 1em;
border-top: 1px solid white;
}
div:target {
background-color: #ff0;
}
div p {
height: 0;
margin: 0;
color: #678;
overflow: hidden;
-moz-transition: height 1s, color 1s;
-ms-transition: height 1s, color 1s;
-o-transition: height 1s, color 1s;
-webkit-transition: height 1s, color 1s;
transition: height 1s, color 1s;
}
div:target p {
height: 100px;
color: maroon;
}
Please Whitelist JSFiddle in your content blocker.
Help keep JSFiddle free for always by one of two ways:
Whitelist JSFiddle in your content blocker (two clicks)
Go PRO and get access to additional PRO features →
Join the 4+ million users, and keep the JSFiddle dream alive.
Ad-free
All ads in the editor and listing pages are turned completely off.
Use pre-released features
You get to try and use features (like the Palette Color Generator) months before everyone else.
Fiddle collections
Sort and categorize your Fiddles into multiple collections.
Private collections and fiddles
You can make as many Private Fiddles, and Private Collections as you wish!
Console
Debug your Fiddle with a minimal built-in JavaScript console.