I want to have a .png image to be 1) exactly in the centre of a div, no matter the device size and 2) to be above another .png image in the same div. Here is my html:
<div class="col-sm-6">
<div id="spinningDial">
<img src="redphone.png" id="phone"/>
<img src="RadialSlime.png" id="radial" class="rotate" style="width: 100%;">
</div>
</div>
And here is my CSS:
#phone {
position: absolute;
left: 67%;
top: 45%;
z-index: 10;
opacity: 100%;
width: 200px;
}
The redphone.png is the image I'm referring to in my specifications above.
Using position: absolute; and z-index: 10; seems like the only way I get the .png to be above the other image, but it seems to place it outside the div. Whereas using, say, position: relative; with the same z-index displaces the png above the other image but keeps it contained in the same div.
This is the web page, if anyone wants to view the page source and see all the code.