1
<!DOCTYPE html>
<html lang="es">
<head>
<meta charset="UTF-8">
<title>Dimensiones y Límites CSS</title>
<style>
body {
font-family: Arial, Helvetica, sans-serif;
background-color: #f1f5f9;
margin: 0;
padding: 20px;
}
/* Caja con max-width y min-height */
.panel-responsivo {
width: 100%;
max-width: 580px; /* Tope máximo en monitores */
min-height: 220px; /* Altura mínima garantizada */
margin: 0 auto;
background-color: #ffffff;
border: 1px solid #cbd5e1;
border-radius: 12px;
padding: 24px;
box-sizing: border-box;
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
display: flex;
flex-direction: column;
justify-content: space-between;
}
/* Imagen totalmente responsiva */
.banner-muestra {
width: 100%;
max-width: 100%;
height: 120px;
background: linear-gradient(135deg, #0284c7, #6366f1);
border-radius: 8px;
display: flex;
align-items: center;
justify-content: center;
color: white;
font-weight: bold;
font-size: 1.1rem;
margin-bottom: 16px;
}
.pie-panel {
border-top: 1px solid #e2e8f0;
padding-top: 12px;
font-size: 0.85rem;
color: #64748b;
display: flex;
justify-content: space-between;
align-items: center;
}
.boton-minimo {
min-width: 140px; /* Asegura un botón cómodo para tocar con el pulgar */
padding: 8px 16px;
background-color: #0284c7;
color: white;
border: none;
border-radius: 6px;
font-weight: 600;
cursor: pointer;
}
</style>
</head>
<body>
<div class="panel-responsivo">
<div>
<div class="banner-muestra">
max-width: 100% (Fluido)
</div>
<h3 style="margin: 0 0 8px 0; color: #0f172a;">Control Dimensional Responsivo</h3>
<p style="margin: 0 0 16px 0; color: #475569; font-size: 0.95rem; line-height: 1.5;">
Este contenedor usa <code>max-width: 580px</code> y <code>min-height: 220px</code>. Si reduces el ancho del navegador, la caja se ajustará suavemente sin generar barras de desplazamiento horizontales.
</p>
</div>
<div class="pie-panel">
<span>Kilopolis Academia</span>
<button class="boton-minimo">Confirmar »</button>
</div>
</div>
</body>
</html>
Haz clic para editar este código