I have this block of HTML for a banner in my header:
<div class="grid grid-cols-1 md:grid-cols-2 overflow-hidden md:max-h-[600px]">
<div class="order-0 flex relative overflow-hidden">
<img src="//cdn.shopify.com/s/files/1/0240/9337/files/jlab-pumpkin-mobile.jpg?v=1665682170&width=1024" srcset="//cdn.shopify.com/s/files/1/0240/9337/files/jlab-pumpkin-mobile.jpg?v=1665441767&width=256 256w, //cdn.shopify.com/s/files/1/0240/9337/files/jlab-pumpkin-mobile.jpg?v=1665441767&width=512 512w, //cdn.shopify.com/s/files/1/0240/9337/files/jlab-pumpkin-mobile.jpg?v=1665441767&width=1024 1024w" width="1024" height="295" loading="lazy" class="block md:hidden h-full w-auto absolute">
<img src="//cdn.shopify.com/s/files/1/0240/9337/files/jlab-pumpkin-desktop_e331677a-5bf1-40b9-9653-924a8e1497e8.jpg?v=1665441775&width=1024" srcset="//cdn.shopify.com/s/files/1/0240/9337/files/jlab-pumpkin-desktop_e331677a-5bf1-40b9-9653-924a8e1497e8.jpg?v=1665441775&width=256 256w, //cdn.shopify.com/s/files/1/0240/9337/files/jlab-pumpkin-desktop_e331677a-5bf1-40b9-9653-924a8e1497e8.jpg?v=1665441775&width=512 512w, //cdn.shopify.com/s/files/1/0240/9337/files/jlab-pumpkin-desktop_e331677a-5bf1-40b9-9653-924a8e1497e8.jpg?v=1665441775&width=1024 1024w" width="1024" height="514" loading="lazy" class="hidden md:block max-w-full max-h-full h-auto absolute">
<div class="flex relative h-auto w-100 py-20 md:py-0">
<div class="w-100 text-white self-center items-center justify-center text-center display">
<h2 class="page-semigiga uppercase m-0">Ready to slay this</h2>
<p class="page-giga text-anc m-0 lobster">Halloween?</p>
<a class="mt-6 inline-block halloween-one-off-button bg-white" href="pages/halloween-costumes">Shop Now</a>
</div>
</div>
</div>
<div class="-order-1 md:order-1 flex overflow-hidden">
<img src="//cdn.shopify.com/s/files/1/0240/9337/files/jlab-cosutmes-mobile.jpg?v=1665443113&width=1024" srcset="//cdn.shopify.com/s/files/1/0240/9337/files/jlab-cosutmes-mobile.jpg?v=1665443113&width=256 256w,//cdn.shopify.com/s/files/1/0240/9337/files/jlab-cosutmes-mobile.jpg?v=1665443113&width=512 512w, //cdn.shopify.com/s/files/1/0240/9337/files/jlab-cosutmes-mobile.jpg?v=1665443113&width=1024 1024w" width="1024" height="410" loading="lazy" class="block md:hidden max-w-full max-h-full h-auto">
<img src="//cdn.shopify.com/s/files/1/0240/9337/files/costumes-textoverlay-dekstop.jpg?v=1665682172?v=1665441733&width=1024" srcset="//cdn.shopify.com/s/files/1/0240/9337/files/costumes-textoverlay-dekstop.jpg?v=1665441733&width=256 256w, //cdn.shopify.com/s/files/1/0240/9337/files/costumes-textoverlay-dekstop.jpg?v=1665441733&width=512 512w, //cdn.shopify.com/s/files/1/0240/9337/files/costumes-textoverlay-dekstop.jpg?v=1665441733&width=1024 1024w" width="1024" height="510" loading="lazy" class="hidden md:block max-w-full max-h-full h-auto">
</div>
</div>
When I attempt to make the whole banner a link by wrapping it in an a tag, Shopify takes it upon themselves to screw it up and make a bunch of them all over the HTML:
Input HTML:
<a href="pages/halloween-costumes">
<div class="grid grid-cols-1 md:grid-cols-2 overflow-hidden md:max-h-[600px]">
<div class="order-0 flex relative overflow-hidden">
<img src="//cdn.shopify.com/s/files/1/0240/9337/files/jlab-pumpkin-mobile.jpg?v=1665682170&width=1024" srcset="//cdn.shopify.com/s/files/1/0240/9337/files/jlab-pumpkin-mobile.jpg?v=1665441767&width=256 256w, //cdn.shopify.com/s/files/1/0240/9337/files/jlab-pumpkin-mobile.jpg?v=1665441767&width=512 512w, //cdn.shopify.com/s/files/1/0240/9337/files/jlab-pumpkin-mobile.jpg?v=1665441767&width=1024 1024w" width="1024" height="295" loading="lazy" class="block md:hidden h-full w-auto absolute">
<img src="//cdn.shopify.com/s/files/1/0240/9337/files/jlab-pumpkin-desktop_e331677a-5bf1-40b9-9653-924a8e1497e8.jpg?v=1665441775&width=1024" srcset="//cdn.shopify.com/s/files/1/0240/9337/files/jlab-pumpkin-desktop_e331677a-5bf1-40b9-9653-924a8e1497e8.jpg?v=1665441775&width=256 256w, //cdn.shopify.com/s/files/1/0240/9337/files/jlab-pumpkin-desktop_e331677a-5bf1-40b9-9653-924a8e1497e8.jpg?v=1665441775&width=512 512w, //cdn.shopify.com/s/files/1/0240/9337/files/jlab-pumpkin-desktop_e331677a-5bf1-40b9-9653-924a8e1497e8.jpg?v=1665441775&width=1024 1024w" width="1024" height="514" loading="lazy" class="hidden md:block max-w-full max-h-full h-auto absolute">
<div class="flex relative h-auto w-100 py-20 md:py-0">
<div class="w-100 text-white self-center items-center justify-center text-center display">
<h2 class="page-semigiga uppercase m-0">Ready to slay this</h2>
<p class="page-giga text-anc m-0 lobster">Halloween?</p>
<a class="mt-6 inline-block halloween-one-off-button bg-white" href="pages/halloween-costumes">Shop Now</a>
</div>
</div>
</div>
<div class="-order-1 md:order-1 flex overflow-hidden">
<img src="//cdn.shopify.com/s/files/1/0240/9337/files/jlab-cosutmes-mobile.jpg?v=1665443113&width=1024" srcset="//cdn.shopify.com/s/files/1/0240/9337/files/jlab-cosutmes-mobile.jpg?v=1665443113&width=256 256w,//cdn.shopify.com/s/files/1/0240/9337/files/jlab-cosutmes-mobile.jpg?v=1665443113&width=512 512w, //cdn.shopify.com/s/files/1/0240/9337/files/jlab-cosutmes-mobile.jpg?v=1665443113&width=1024 1024w" width="1024" height="410" loading="lazy" class="block md:hidden max-w-full max-h-full h-auto">
<img src="//cdn.shopify.com/s/files/1/0240/9337/files/costumes-textoverlay-dekstop.jpg?v=1665682172?v=1665441733&width=1024" srcset="//cdn.shopify.com/s/files/1/0240/9337/files/costumes-textoverlay-dekstop.jpg?v=1665441733&width=256 256w, //cdn.shopify.com/s/files/1/0240/9337/files/costumes-textoverlay-dekstop.jpg?v=1665441733&width=512 512w, //cdn.shopify.com/s/files/1/0240/9337/files/costumes-textoverlay-dekstop.jpg?v=1665441733&width=1024 1024w" width="1024" height="510" loading="lazy" class="hidden md:block max-w-full max-h-full h-auto">
</div>
</div>
</a>
Output HTML:
<a href="pages/halloween-costumes">
</a><div class="grid grid-cols-1 md:grid-cols-2 overflow-hidden md:max-h-[600px]"><a href="pages/halloween-costumes">
</a><div class="order-0 flex relative overflow-hidden"><a href="pages/halloween-costumes">
<img src="//cdn.shopify.com/s/files/1/0240/9337/files/jlab-pumpkin-mobile.jpg?v=1665682170&width=1024" srcset="//cdn.shopify.com/s/files/1/0240/9337/files/jlab-pumpkin-mobile.jpg?v=1665441767&width=256 256w, //cdn.shopify.com/s/files/1/0240/9337/files/jlab-pumpkin-mobile.jpg?v=1665441767&width=512 512w, //cdn.shopify.com/s/files/1/0240/9337/files/jlab-pumpkin-mobile.jpg?v=1665441767&width=1024 1024w" width="1024" height="295" loading="lazy" class="block md:hidden h-full w-auto absolute">
<img src="//cdn.shopify.com/s/files/1/0240/9337/files/jlab-pumpkin-desktop_e331677a-5bf1-40b9-9653-924a8e1497e8.jpg?v=1665441775&width=1024" srcset="//cdn.shopify.com/s/files/1/0240/9337/files/jlab-pumpkin-desktop_e331677a-5bf1-40b9-9653-924a8e1497e8.jpg?v=1665441775&width=256 256w, //cdn.shopify.com/s/files/1/0240/9337/files/jlab-pumpkin-desktop_e331677a-5bf1-40b9-9653-924a8e1497e8.jpg?v=1665441775&width=512 512w, //cdn.shopify.com/s/files/1/0240/9337/files/jlab-pumpkin-desktop_e331677a-5bf1-40b9-9653-924a8e1497e8.jpg?v=1665441775&width=1024 1024w" width="1024" height="514" loading="lazy" class="hidden md:block max-w-full max-h-full h-auto absolute">
</a><div class="flex relative h-auto w-100 py-20 md:py-0"><a href="pages/halloween-costumes">
</a><div class="w-100 text-white self-center items-center justify-center text-center display"><a href="pages/halloween-costumes">
<h2 class="page-semigiga uppercase m-0">Ready to slay this</h2>
<p class="page-giga text-anc m-0 lobster">Halloween?</p>
</a><a class="mt-6 inline-block halloween-one-off-button bg-white" href="pages/halloween-costumes">Shop Now</a>
</div>
</div>
</div>
<div class="-order-1 md:order-1 flex overflow-hidden">
<img src="//cdn.shopify.com/s/files/1/0240/9337/files/jlab-cosutmes-mobile.jpg?v=1665443113&width=1024" srcset="//cdn.shopify.com/s/files/1/0240/9337/files/jlab-cosutmes-mobile.jpg?v=1665443113&width=256 256w,//cdn.shopify.com/s/files/1/0240/9337/files/jlab-cosutmes-mobile.jpg?v=1665443113&width=512 512w, //cdn.shopify.com/s/files/1/0240/9337/files/jlab-cosutmes-mobile.jpg?v=1665443113&width=1024 1024w" width="1024" height="410" loading="lazy" class="block md:hidden max-w-full max-h-full h-auto">
<img src="//cdn.shopify.com/s/files/1/0240/9337/files/costumes-textoverlay-dekstop.jpg?v=1665682172?v=1665441733&width=1024" srcset="//cdn.shopify.com/s/files/1/0240/9337/files/costumes-textoverlay-dekstop.jpg?v=1665441733&width=256 256w, //cdn.shopify.com/s/files/1/0240/9337/files/costumes-textoverlay-dekstop.jpg?v=1665441733&width=512 512w, //cdn.shopify.com/s/files/1/0240/9337/files/costumes-textoverlay-dekstop.jpg?v=1665441733&width=1024 1024w" width="1024" height="510" loading="lazy" class="hidden md:block max-w-full max-h-full h-auto">
</div>
</div>
</div>
Why is Shopify screwing up my HTML?