Elementos flexibles que no se centran verticalmente

Intento centrar verticalmente el contenido con cajas flexibles sin éxito. No me gusta usar position o translate porque no tiene un tamaño fijo. ¿Qué pasa con mi código?

 .row-centered { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; } .col-centered { display: flex; flex-direction: column; align-self: flex-start; float: none; margin-right: 0 auto; } .us-container{ display: flex; justify-content: center; align-items: center; vertical-align: middle; resize: both; overflow: auto; } .us-container div{ resize: both; overflow: auto; } 
   

blah blah blah blah blah blahblah blah blahblah blah blahblah blah blahblah blah blahblah blah blahblah blah blahblah blah blahblah blah blahblah blah blahblah blah blahblah blah blahblah blah blahblah blah blahblah blah blahblah blah blahblah blah blahblah blah blahblah blah blahblah blah blahblah blah blahblah blah blahblah blah blahblah blah blahblah blah blahblah blah blahblah blah blahblah blah blah

blah blah blah

Su contenedor flexible no tiene altura extra. La única altura es la altura del contenido. Por lo tanto, no hay espacio para el centrado vertical.

Primer paso, agrega algo de altura:

 .row-centered { display: flex; height: 100vh; } 

Segundo paso, eliminar reglas innecesarias, algunas de las cuales impiden la alineación vertical.

 .col-centered { display: flex; flex-direction: column; /* align-self: flex-start; float: none; margin-right: 0 auto; */ } 
 .row-centered { display: flex; height: 100vh; } .col-centered { display: flex; flex-direction: column; } .us-container { display: flex; justify-content: center; align-items: center; } 
  

blah blah blah blah blah blahblah blah blahblah blah blahblah blah blahblah blah blahblah blah blahblah blah blahblah blah blahblah blah blahblah blah blahblah blah blahblah blah blahblah blah blahblah blah blahblah blah blahblah blah blahblah blah blahblah blah blahblah blah blahblah blah blahblah blah blahblah blah blahblah blah blahblah blah blahblah blah blahblah blah blahblah blah blahblah blah blah

blah blah blah

Agregue height: 100% a html, body, .container-fluid y make .container-fluid también sea un contenedor flexible como se muestra a continuación.

 html, body, .container-fluid { height: 100%; } .row-centered, .container-fluid { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; } .col-centered { display: flex; flex-direction: column; align-self: flex-start; float: none; margin-right: 0 auto; } .us-container{ display: flex; justify-content: center; align-items: center; vertical-align: middle; resize: both; overflow: auto; } .us-container div{ resize: both; overflow: auto; } 
  

blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah

blah blah blah