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

338
Views
css word-wrap no funciona para ajustar el texto en div

css word-wrap no funciona correctamente para envolver texto dentro de div, funcionará si no uso javascript pero combinado con mi código JS, el texto saldrá de mi borde

Este es el resultado que estoy buscando: ingrese la descripción de la imagen aquí

 const quotes = [ { text: '111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111', }, { text: '222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222', }, ] const text = document.querySelector('.text'); function randButton() { let random = Math.floor(Math.random() * quotes.length); text.innerHTML = quotes[random].text; } randButton();
 .example-1 { display: -webkit-box; display: -ms-flexbox; display: flex; -webkit-box-align: center; -ms-flex-align: center; align-items: center; -webkit-box-pack: justify; -ms-flex-pack: justify; background: white; border-style: solid; border-radius: 5px; padding: 3px 3px 3px 3px; width: 425px; }
 <div class="example-1" > <div id="wallet_btc" class="text example"> </div> </div> <br> <button onclick="randButton()" id="aaa" class="btn btn-primary a55" value="button" type="button" style="font-size:18px">Random</button>

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

0

Puedes deshacerte de todos tus elementos flex y simplemente hacer word-break: break-all; como esto:

 const quotes = [ { text: '111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111' }, { text: '222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222' }, ]; const text = document.querySelector('.text'); function randButton() { let random = Math.floor(Math.random() * quotes.length); text.innerHTML = quotes[random].text; } randButton();
 .inner-style { background: white; border-style: solid; border-radius: 5px; padding: 3px 3px 3px 3px; width: 425px; word-break: break-all; }
 <div class="style1" > <div id="wallet_btc" class="text inner-style"> </div> </div> <br/> <button onclick="randButton()" id="aaa" class="btn btn-primary a55" value="button" type="button" style="font-size:18px">Random</button>

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!