Just wondering if there is a better way to write this CSS? It repeats quite a lot, this is a simple example, does it have to be this way?
<style type="text/css">
div#leftBlock
{
position:absolute;
z-index: 1;
}
div#rightBlock
{
position:absolute;
z-index: 1;
}
div#centerBlock
{
position:absolute;
z-index: 2;
}
div#animateblock
{
position:absolute;
z-index: 3;
}
</style>
...
<div id="leftBlock" onclick="leftClick()"></div>
<div id="rightBlock" onclick="rightClick()"></div>
<div id="centerBlock" onclick="centerClick()"></div>
<div id="animateBlock"></div>
This perhaps:
Edit added this: the most minimalist way would be to code the html like so (drop the ids):
and the css like so:
But that depends on your needs, as you may need the ids for something else.