I am currently working on a project involving an image gallery. My goal is to showcase the images in a specific layout:
https://i.sstatic.net/cXcql.png
Essentially, the image should always be centered. If there is sufficient space to the right, I want to place a <div>
that contains additional information next to the image. However, if the screen size decreases, the information box should shift below the image.
I came across a similar inquiry where the solution involved positioning the information box to the right of the image regardless of screen size. Here is the code snippet from that post: Link
How can I modify this approach so that the information box aligns below the image on smaller screens? I am utilizing Bootstrap 4 for this project.
Edit I attempted to implement Zim's solution, but encountered issues with vertical images: https://i.sstatic.net/CWfGM.png Ideally, I would like the metadata box to appear beside the image... Here is the HTML markup:
<div class="container-fluid">
<div class="row align-items-md-end">
<div class="px-1 col-xl-6 offset-xl-3 text-center">
<div class="photoboxTest">
<div class="text-center">
<img class="img-fluid" src="https://res.cloudinary.com/ddofbxz8d/image/upload/v1543814237/nwzv41b8gddr1uf873ki.jpg">
</div>
<div class="my-navigation d-flex justify-content-between">
<a class="icon"><i class="fas fa-info-circle mx-2" style="color: transparent"></i></a>
<div class="d-flex justify-content-center">
<a class="icon" href="#"><i class="fas fa-chevron-left"></i></a>
<a class="icon" href="/photos"><i class="fas fa-th mx-3"></i></a>
<a class="icon" href="#"><i class="fas fa-chevron-right"></i></a>
</div>
<a class="icon" href="#"><i class="fas fa-info-circle mx-2"></i></a>
</div>
</div>
</div>
<div class="px-1 col-xl-3">
<div class="metabox ">
<div class="my-title text-center">
<h4>Metadata</h4>
</div>
<div class="my-metadata">
<table style="width:100%">
<tr>
<td>Date</td>
<td>10.12.1992</td>
</tr>
<tr>
<td>Time</td>
<td>12:14</td>
</tr>
<tr>
<td>Location</td>
<td>This 1 nice location</td>
</tr>
<tr>
<td>Focal length</td>
<td>80 mm</td>
</tr>
<tr>
<td>Aperture</td>
<td>f/10</td>
</tr>
<tr>
<td>Exposuse time</td>
<td>10 s</td>
</tr>
<tr>
<td>ISO</td>
<td>200</td>
</tr>
</table>
</div>
</div>
</div>
</div>