Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

199
Views
¿Por qué el lienzo no se comporta correctamente?

Quiero CANVAS (parte gris) para cubrir siempre la pantalla.
Pero cubre demasiado.
¿Qué hacer?
(No quiero usar CSS)

 resize(); function resize() { document.getElementById("can").style.width = window.innerWidth + "px"; document.getElementById("can").style.height = window.innerHeight + "px"; }
 body { margin: 0; padding: 0; } #can { margin: 0; padding: 0; background-color: #eee; }
 <body onresize="resize();"> <canvas id="can" /> </body>

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Necesitas agregar display: block; css a su lienzo.

 resize(); function resize() { document.getElementById("can").style.width = window.innerWidth + "px"; document.getElementById("can").style.height = window.innerHeight + "px"; } window.addEventListener('resize', resize);
 body { margin: 0; padding: 0; } #can { display: block; margin: 0; padding: 0; background-color: #eee; }
 <canvas id="can" />

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!