I'm having trouble getting an image in a DIV to display above text in another DIV. I can't figure out why it's only displaying below.
<div>
<div style='z-index: 99; width: 160px; height: 120px; box-shadow: 0px 0px 16px 0px rgba(0,0,0,0.75); margin-top: 16px; margin-left: 10px; border: 1px solid black;'>
<img border=0 width=160 height=120 alt='W1A 1AA' src='upload/[W1A 1AA][221b].jpg'>
</div>
<div style='margin-top: 20px; padding-left: 190px; background: gray; position: relative; top: -130px;'>
<h3 style='margin: 0px; color: white;'>Viewing as read-only an existing Inspection Survey</h3>
</div>
<div style='padding-left: 190px; background: lightgray; position: relative; top: -130px;'>
<h1 style='margin: 0px;'>W1A 1AA</h1>
<h2 style='margin: 0px;'>221b Baker Street</h2>
</div>
</div>
This is the result:
I suspect the issue arises from using position: relative;
to position the gray bars correctly. If that is indeed the problem, how can I achieve the desired outcome without relying on position: relative;
?