Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

759
Vistas
Setting full height of Angular Components

I cannot get my list to be full height. My code is more complicated with nested components. But I can still get this to replicate using this code. Here is a plunk. http://plnkr.co/edit/R0QgLz8cjyRHYOLf4uJW

styles.css

html, body {
  min-height: 100%;
  height: auto;
  margin: 0;
}

app.component.css

.container {
height: 100%;
background: black;
color: white;

list.component.css

.row {
  display: flex;
  flex-direction: row;
}
.list {
  width: 33%;
  height: 100%;
  flex-direction: column;
  display: flex;
  border-right: groove white 1px;
  border-top: groove white 1px;
}
.item {
  width: auto;
  height: 100%;
  flex-direction: column;
  display: flex;
}

list.component.html

<div class="contents">
  <button (click)="updateDocuments()">Update Document</button>
  <div class="row">
    <div class="list">
      <div *ngFor="let document of documents; let i = index;">
        {{i + 1}}. {{document}}
      </div>
    </div>
    <div class="item">
      this is an item
    </div>
  </div>
</div>
about 4 years ago · Santiago Trujillo
3 Respuestas
Responde la pregunta

0

I got this to work by switching to height 100vh and also adding a overflow-y: scroll css attribute to the list and item classes.

http://plnkr.co/edit/R0QgLz8cjyRHYOLf4uJW

styles.css

html, body {
  min-height: 100vh;
  height: auto;
  margin: 0;
}

app.component.css

.container {
height: 100vh;
background: black;
color: white;

list.component.css

.row {
  display: flex;
  flex-direction: row;
}
.list {
  width: 33%;
  height: 100vh;
  flex-direction: column;
  display: flex;
  border-right: groove white 1px;
  border-top: groove white 1px;
  overflow-y: scroll;
}
.item {
  width: auto;
  height: 100vh;
  flex-direction: column;
  display: flex;
  overflow-y: scroll;
}

list.component.html

<div class="contents">
  <button (click)="updateDocuments()">Update Document</button>
  <div class="row">
    <div class="list">
      <div *ngFor="let document of documents; let i = index;">
        {{i + 1}}. {{document}}
      </div>
    </div>
    <div class="item">
      this is an item
    </div>
  </div>
</div>
about 4 years ago · Santiago Trujillo Denunciar

0

try to write this css

.container{
    min-height:100vh;
}
about 4 years ago · Santiago Trujillo Denunciar

0

Had the same issue, and found that the best solution was:

html, body {
  min-height:100vh;
  height: auto;
}

and for the container:

.container{
  min-height: 100vh;
}
about 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda