How to adjust div height according to text?

6

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 Leandro Costa 11.02.2014 в 18:19

2 answers

9

Use:

word-wrap: break-word;

in this div.

    
11.02.2014 / 18:22
0

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