我有一个relative
div。在这个 div 中,我想将图像居中(所以狗的脸是可见的)。我怎么能这样做?
<link href="https://cdn.jsdelivr.net/npm/tailwindcss/dist/tailwind.min.css" rel="stylesheet"/>
<div class="relative h-24 overflow-hidden">
<img class="absolute w-full h-auto" src="https://www.petmd.com/sites/default/files/Acute-Dog-Diarrhea-47066074.jpg" />
</div>