[Vuejs]-Tailwind.css – a "fixed" element is out the parent "container" element

1👍

yes, that’s what fixed elements do (i.e. they are at a fixed position in the viewport/window). Use position: absolute to position an element relatively to its parent. And apply position: relative to the parent in this case.

0👍

I’ve found what I was looking for…

<!-- Parent -->    
<div class="relative container max-w-screen-xl bg-slate-200 pb-4">
  <!-- Child - fixed element -->
  <div class="fixed w-full max-w-screen-xl bottom-[10%] flex flex-row justify-end pr-16"></div>
</div>

Thank you for your help !
Best regards,
LN

Leave a comment