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

190
Visualizações
How do I set browser ABSOLUTE zoom level using CSS/Javascript?

Things such as

document.body.style.zoom = 1.5;

in Javascript, and

body{zoom: 150%;} 

in CSS do not set absolute zoom level to 150%, they change it relatively to the current level.

How can I set it in an absolute way?

about 4 years ago · Juan Pablo Isaza
2 Respostas
Responde à pergunta

0

Using the transform: scale property, you can get what you want. Just apply the property to the body and you can get something that mimics the zoom property. In the code below, the body tag is zoomed in by 150%

   body {
        transform: scale(1.5, 1.5)
    }
about 4 years ago · Juan Pablo Isaza Relatório

0

A percentage is a relative measurement, according to the mdn web docs even if you input a number it will be converted to its relative percentage. It also seems like zoom is a property not very supported. You can use transform: scale(factor) instead however this is also relative. If you want something exact you should probably just change the width and the height of the element and make it's inside react responsively. However, I'm really unaware of what you're trying to achieve or the context. I don't really understand why you'd want an absolute measurement to scale/zoom something.

about 4 years ago · Juan Pablo Isaza 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