• Empleos
  • Sobre nosotros
  • profesionales
    • Inicio
    • Empleos
    • Cursos y retos
  • empresas
    • Inicio
    • Publicar vacante
    • Nuestro proceso
    • Precios
    • Evaluaciones
    • Nómina
    • Blog
    • Comercial
    • Calculadora de salario

0

125
Vistas
Why are there scroll bars despite fitting a canvas exactly to the screen

I have a page with exactly one visible element: a canvas. I am setting the canvas' width & height to be exactly the width and height of the window (window.innerWidth and window.innerHeight), however horizontal and vertical scroll bars still appear and allow me to scroll around a very small amount. None of my elements have any border, padding, or margin (including body, which I specifically set to have none). Is there a better way to make a canvas take up the entire screen, or should I simply subtract a fixed amount from the width & height, and what would that be?

almost 3 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Add style with overflow of hidden.

<style>
body {
  overflow: hidden;
}
</style>
almost 3 years ago · Juan Pablo Isaza 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 Nuestro proceso Comercial
Legal
Términos y condiciones Política de privacidad
© 2025 PeakU Inc. All Rights Reserved.

Andres GPT

Recomiéndame algunas ofertas
Necesito ayuda