Quellcode durchsuchen

Opencode añade img-fluid para que la imagen no se salga del contenedor

Celestino Rey vor 3 Monaten
Ursprung
Commit
d543333074

+ 1 - 1
src/templates/repostajes/detalle_vehiculo.html

@@ -17,7 +17,7 @@
             <div class="row g-3 align-items-center">
                 <div class="col-12 col-lg-auto text-center text-lg-start">
                     {% if vehiculo.foto %}
-                    <p><img src="{{ vehiculo.foto.url }}" alt="{{ vehiculo.matricula}}" style="width: 484px; height: 343px; object-fit: cover;"></p>
+                    <p><img src="{{ vehiculo.foto.url }}" alt="{{ vehiculo.matricula}}" class="img-fluid" style="max-width: 100%; height: auto; max-height: 343px; object-fit: contain;"></p>
                     {% else %}
                     <p>No hay imágen disponible</p>
                     {% endif %}

+ 1 - 1
src/templates/repostajes/lista_vehiculos.html

@@ -31,7 +31,7 @@
 							<div class="app-card-body p-3 has-card-actions">
 							    
                                 {% if vehiculo.foto %}
-                                <img src="{{ vehiculo.foto.url }}" alt="Foto del vehiculo" style="width: 187px; height: 115px; object-fit: cover;">
+                                <img src="{{ vehiculo.foto.url }}" alt="Foto del vehiculo" class="img-fluid" style="height: 115px; object-fit: cover;">
 						        {% else %}
 									Sin imágen
 								{% endif %}