I have a project that I am currently trying to refactor and am wondering if it is possible to stack images within a flex container?
Here is the HTML for reference:
<div id="dealWrapper">
<!-- HEADER START -->
<div id="flexContainer">
<div id="bigImage">
<a href="/link"><img id="orgZ" src="https://i.imgur.com/1KWyDov.jpg" alt="Image of Food" /></a>
<a href="/link"><img id="gluZ" src="https://i.imgur.com/9GHwSZR.jpg" alt="Image of Food" /></a>
<a href="/link"><img id="sugZ" src="https://i.imgur.com/ugltt9v.jpg" alt="Image of Food" /></a>
<a href="/link"><img id="vegZ" src="https://i.imgur.com/zi9R9yl.jpg" alt="Image of Food" /></a>
<a href="/link"><img id="ketZ" src="https://i.imgur.com/SSd9KST.jpg" alt="Image of Food" /></a>
<a href="/link"><img id="palZ" src="https://i.imgur.com/zs92uob.jpg" alt="Image of Food" /></a>
</div>
<ul class="flexUL">
<li class="vm_clickable" id="organic" data-src="/" data-url="/">
<a href="/link">Organic</a>
</li>
<li class="vm_clickable" id="glutenFree" data-src="/" data-url="/">
<a href="/link">Gluten-Free</a>
</li>
<li class="vm_clickable" id="sugarFree" data-src="/" data-url="/">
<a href="/link">Sugar-Free</a>
</li>
<li class="vm_clickable" id="vegan" data-src="/" data-url="/">
<a href="/link">Vegan</a>
</li>
<li class="vm_clickable" id="keto" data-src="/" data-url="/">
<a href="/link">Keto</a>
</li>
<li class="vm_clickable" id="paleo" data-src="/" data-url="/">
<a href="/link">Paleo</a>
</li>
</ul>
</div>
<!-- END FLEX CONTAINER -->
</div>
<!-- deal wrapper end -->
I would like to stack the images displayed on top of each other (varying z index of course). Is this possible? As far as I know you have to use position:absolute to do this. Seems guaranteed to interfere with flex styles of the previous design. Do I need to get rid of flex and set up the CSS positioning in another way?
Code Pen for reference: https://codepen.io/gchis66/pen/qBZNgBw
edit: sorry if i wasnt clear about the ultimate goal. Ultimately, I want to stack the images on top of eachother then set a css hover rule on each of the links to the right of the images to show the corresponding image by updating the z index to the highest number.