Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

397
Visualizações
How do you resize the Divs on your page based on screen size?

I am in the middle of completing a coding test. I want to change all my div sizes according to screen size. This is because my test does not look the same on my laptop than it looks on a mac computer monitor. On my small laptop all the divs look big, however on a mac computer monitor it appears to look decent.

over 4 years ago · Santiago Trujillo
3 Respostas
Responde à pergunta

0

Use vh.

Refer Viewport sized typography

Use 100vh and 100vw if you want full width and full height. Else change accordingly.

div {
  height: 100vh;
  width:100vh
}
over 4 years ago · Santiago Trujillo Relatório

0

Use media queries or set width/height in % or vw/vh instead of px
I hope that is the thing you are looking for... Or maybe use framework like bootstrap or foundation

over 4 years ago · Santiago Trujillo Relatório

0

You should use Chrome Developer Tools to check at what resolution you want to change the size of your div!

If you have a div:

#bluebox {
width: 50px;
height: 50px;
background-color: blue;
}
<div id="bluebox">
</div>

But, when the screen size is 480px wide you only want the div to be 25px X 25px you would do like this:

#bluebox {
width: 50px;
height: 50px;
background-color: blue;
}

@media (max-width: 480px) {
  #bluebox {
    width: 25px;
    height: 25px;
  }
}
<div id="bluebox">
</div>

This is done with media queries - which is very simple and standard. I hope it helped!

over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda