I am trying to write some HTML code to overlay another element directly on top of a pre text block.
The problem is, even the most simple example doesn't seem to align correctly...
<div style="position:relative">
<pre style="position:absolute">
hello
</pre>
<div style="position:absolute">
world
</div>
</div>
You can see the output here.
The div element is rendered above the pre element. Why is this happening?
More information on positioning of elements can be found here.