Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

161
Vistas
html force rerender div

I have flex row with max-height. wrapper of image have min-height:0; property for block height overflow;

but after load image and shrink we see that wrapper of image is not recomputer has extra spaced (red rectangle). How i can recomputed div to shrink to image width?

enter image description here

<div class="flex max-h-[300px] justify-start bg-purple-500">

    <div class="flex min-h-0 border-[5px] border-red-700">
      <img class="block w-auto mx-auto border-2 border-green-700" src="https://wallpapershome.ru/images/pages/pic_v/14572.jpg"/>
    </div>
    
</div>

sandbox https://play.tailwindcss.com/td171IEWi6

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Defin a new class and add it to the IMG parrent tage(Border-red). or you can use same class name if you want to ovver-write the defaults.

.border-red-700{
        border: red 5px solid;
        width: max-content;
        position:relative;
        margin: auto;
    }

also change the image height equal to the DIV tag height (300px);

<img class="block w-auto mx-auto border-2 border-green-700 max-h-[280px]" src="https://wallpapershome.ru/images/pages/pic_v/14572.jpg"/>
about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda