I'm facing an issue with absolute positioning of images in Bootstrap. When the screen size decreases, the second column is supposed to move below the first column but instead, it overlaps the image. Here's my current code:
<div class="row">
<div class="col-lg-8 col-md-12 col-sm-12 col-xs-12">
<div id="imgdiv">
<img id="ximage" src="css/images/x-ray-lat-left.png" width="578" height="715" border="0"/>
<img id="emptygif" src="http://upload.wikimedia.org/wikipedia/commons/c/ce/Transparent.gif" width="578" height="715" usemap="#location-map" border="0"/>
<img id="overlayr1"> </img>
<img id="overlayr2"> </img>
<img id="overlayr3"> </img>
<map name="location-map" id="location-map" border="0">
<area id="r1" shape="rect" coords="250,250,340,370" href="#" alt="Hilum"/>
<area id="r2" shape="rect" coords="90,150,340,500" href="#" alt="Heart"/>
<area id="r3" shape="rect" coords="130,120,460,530" href="#" alt="Right Lung"/>
</map>
</div>
</div>
<div class="col-lg-3 col-md-6 col-sm-10 col-xs-10">
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">Information</h3>
</div>
<div id="imgdesc" class="panel-body">
Description of the image
</div>
</div>
</div>
The images in the first column are positioned like this:
#ximage{
position:absolute;
left:0;
right:0;
margin-left:auto;
margin-right:auto;
background-repeat: no-repeat;
z-index:0;
}
For md
, sm
, and xs
screen sizes, the second column should be below the first one, but due to the absolute positioning, it overlaps them.
Any suggestions on how I can resolve this?