Heriberto Nol Heriberto Nol - 4 months ago 9
MySQL Question

text emerging out of a css box when showing the publications that are saved in a mysql data base

I have a page where results of a query to mysql db are shown, everything works fine but if i need to write a long line without spaces it emerges out of the text box i have
I would like to get the text inside of the white box
screen shot:
[Image screen shot]
code:

.caja-comentario{
margin-bottom:0;
margin-top:0;
margin-left:auto;
margin-right:auto;
width:400px;
min-height:10px;
background: white;
}

Answer

Just add these CSS properties to the element where you place the text:

word-wrap:break-word;
word-break:break-all;

Demo: https://jsfiddle.net/4wtoek7m/1