How to adjust div height according to text?


I created a div with a defined width, but when I insert a very large word, the text continues to come out of the div, how do I continue on the bottom line?

asked by anonymous 11.02.2014 / 18:19

2 answers



word-wrap: break-word;

in this div.

11.02.2014 / 18:22

To solve this I always use the float: property.

For example:

.minhaDiv { float:left; width:200px; }

Whenever your text gets close to the size of this div , it will "break" to the bottom line.

11.02.2014 / 19:31