Tengo un div con 15% de altura ( height: 15%; )
No puedo poner el botón set span de este div. Si uso height: 300px; funciona bien. pero con porcentaje de altura no funciona. ¿por qué?
#parent { height: 15%; position: relative; } span { position: absolute; bottom: 0; }Puede llenar la altura del cuerpo usando 100vh;
body { height: 100vh; } #parent { position: relative; width: 15%; height: 15%; background-color: red; } span { position: absolute; color: white; text-align: center; width: 100%; bottom: 0; } <div id="parent"> <span>Hello</span> </div>