Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

306
Vistas
Why does `word-wrap / overflow-wrap: break-word` break right at this point?

Both for word-wrap: break-word; and overflow-wrap: break-word; CSS properties i have a premature breaking problem at the very end like in this case. Besides, with longer strings I even witnessed this problem manifest itself in different forms like not breaking at all at the expected end of the line or self inventing a wider or narrower width for the remaining of the lines.

The question is, when you have a very long string why does overflow-wrap: break-word; "break" at certain unexpected places..?

var str = Array.from({length:65366}, _ => ~~(Math.random()*9) + 1)
               .reduce((s,c) => s + c, ""),
    blk = document.getElementById("block");

blk.textContent = str;
#block{
    margin : 0 auto;
    font-family: monospace;
    width: 90vw;
    overflow-wrap: break-word;
}
<p id="block"></p>

Note: This problem doesn't seem to exist in Firefox but in Chrome and Edge i can see it. Also while scrolling down you may notice that the right margin changes.

about 4 years ago · Juan Pablo Isaza
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 Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda