Tengo un DIV de 400px de ancho, que contiene dos DIV uno al lado del otro, cada uno con un ancho de 400px y una altura de 600px. El ancho de ambos DIV es fijo, sin embargo, la altura puede variar. Me gustaría ocultar el segundo DIV y mostrar el primero por completo, sin desplazamiento dentro del DIV.Overflow-x: hidden también oculta el contenido vertical también
Mi solución, pensé, era ocultar el overflow-x. Esto parece también ocultar el desbordamiento y también.
Aquí está mi código:
#schools-sub-nav {
}
#schools-container {
width: 400px; /* Set the width of the visible portion of content here */
background-color: fuchsia;
position: relative;
overflow-x: hidden;
}
#schools-list {
width: 400px; /* Set the width of the visible portion of content here */
height: 600px; /* Delete the height, let the content define the height */
background-color: purple;
position: absolute;
top: 0;
left: 0;
}
#boards-list {
width: 400px; /* Set the width of the visible portion of content here */
height: 600px; /* Delete the height, let the content define the height */
background-color: green;
position: absolute;
top: 0;
left: 400px;
}
<div id="schools-sub-nav"> <a href="#schools-list">Schools List</a> // <a href="#boards-list">Boards List</a> </div>
<div id="schools-container">
<div id="schools-list"> One </div>
<div id="boards-list"> Two </div>
</div>
espero #schools-list
a ser visibles, pero por alguna razón overflow-x: hidden
en #schools-container
esconde.
Hola Jack, no estoy seguro de entender. Creo que la regla de desbordamiento funciona bien junto con los divs posicionados, puedo probar eso agregando una altura al contenedor. –
@OllyF Acabo de actualizar mi pregunta con un violín. – jackJoe
"Necesita cambiar el tipo de posición (a normal/no absoluto)" <- Esto – Xavier