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

322
Views
cómo arreglar un elemento en la parte inferior mientras el teclado está abierto

Tengo una página que tiene un elemento en la parte inferior de la página. Uso la posición absolute para fijarlo al fondo. Cuando abro el teclado, el elemento va a la mitad de la página.

es una situación normal1

quiero estosegunda imagen

Y este es mi problema tercera imagen

 .container{ position:relative; height:100%; } .myclass{ position : absolute; bottom:0; margin:auto; display:flex; align-items:center; }
about 4 years ago · Santiago Gelvez
1 answers
Answer question

0

Usando

 display:flex; flex-direction: column;

en su contenedor principal

y agregue su elemento .box margin-top: auto; solucionará tu problema, supongo.

presiona el botón

 const container = document.querySelector('.container'); const addButton = document.querySelector('button'); addButton.addEventListener('click', () => { const newDiv = document.createElement('div'); newDiv.style.height = "10rem"; newDiv.style.width = "100%"; newDiv.style.backgroundColor = "red"; container.appendChild(newDiv); })
 *, *::before, *::after{ margin: 0; } body{ min-height: 100vh; } .container{ display: flex; flex-direction: column; text-align: center; width:375px; height: 100vh; margin: 0 auto; background-color: bisque; } .box{ height: 5rem; width: 100%; background-color: blue; margin-top: auto; } button{ position: absolute; width: 5rem; height: 5rem; top: 5rem; right: 5rem; }
 <div class="container"> <h1>Enter text</h1> <div class="box"></div> </div> <button>Add new box</button>

about 4 years ago · Santiago Gelvez 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!