I have tried to collapse a long part of a text on my weblog
using the following construct:
<style>
div.expand { display : none; }
div.expand:hover (display : inline; }
div.expand em {display : inline; }
</style>
<p>Blablabla etc lorem ipsum yadayada</p>
<div class='expand'>
<em>expand!</em>
long list of collapsed text
long list of collapsed text
long list of collapsed text
long list of collapsed text
long list of collapsed text
long list of collapsed text
[...]
</div>
Using the <emtags I hoped to make only the expand! text visible by
default. But it isn't. Everything inside the <divis hidden (I use FF
1.5.0.8 on Linux) myself. Besides, this won't work on IE6, not sure
about 7. But since I don't care much for IE compatibility, I can live
with that (or provide an alternative using a hack).
How should I have approached this, if at all possible using CSS?
Ideally, is there a one-size-fits-all (browsers) solution, other than
JavaScript?
TIA!
Sh.