Quiero colocar los dos divs que se muestran aquí en la parte inferior de su div principal. He intentado especificar esta propiedad en CSS:
position: absolute;Pero termina superponiéndose y los botones se destrozan tan bien como se muestra aquí . Por lo que entiendo, el posicionamiento absoluto haría esto y mi única opción sería usar JS.
Así es como se ve el html:
<div id="box" class="box-192" style="border:1px solid #8c8c8c;padding:20px;"> <h2>theLAO</h2> <div class="box-body"> <p>A DOA supporting the Blockchain ecosystem.</p> <p>Twitter: <a href="https://twitter.com/TheLAOOfficial" onclick="javascript:window.open('https://twitter.com/TheLAOOfficial'); return false;">@TheLAOOfficial</a></p> </div> <div class="button-div"> <a href="https://thelao.io" onclick="javascript:window.open('https://thelao.io/'); return false;"><span class="buttons">visit theLAO ↗</span></a> <a href="https://daodir.co/doa/thelao/"><span class="buttons">discuss theLAO </span></a> </div> </div>...y algo de CSS relevante
.button-div { margin: 0 auto; text-align: center; bottom: 0; padding-top: 25 px; }Si desea visitar el sitio donde esto sucede, visite https://centinl.com
Configure su contenedor para display: flex; y establezca el elemento medio con un flex-grow en 1 para que empuje sus elementos hermanos a sus extremos. No hay necesidad de usar position: absolute; .
#box { display: flex; flex-direction: column; height: 500px; } .box-body { flex-grow: 1; } <div id="box" class="box-192" style="border:1px solid #8c8c8c;padding:20px;"> <h2>theLAO</h2> <div class="box-body"> <p>A DOA supporting the Blockchain ecosystem.</p> <p>Twitter: <a href="https://twitter.com/TheLAOOfficial" onclick="javascript:window.open('https://twitter.com/TheLAOOfficial'); return false;">@TheLAOOfficial</a></p> </div> <div class="button-div"> <a href="https://thelao.io" onclick="javascript:window.open('https://thelao.io/'); return false;"><span class="buttons">visit theLAO ↗</span></a> <a href="https://daodir.co/doa/thelao/"><span class="buttons">discuss theLAO </span></a> </div> </div>