Paragraph html does not "break" and content is hidden

0

I enter several comments that are received from the bank with the code below:

    $retorno = '<ul>';

    while($row = mysqli_fetch_assoc($select)){

        $retorno .= '
            <li id="comentario-resposta-'.$_POST['id'].'" class="comentario-resposta">
                <button class="btn btn-link">'.$row['nome_login'].'</button>
                <p>'.$row['comentario'].'</p>
            </li>
        ';
    }

    $retorno .= "</ul>";

css

.comentario-resposta p{
    display: block;
    position: relative;
    width: 50%;
}

This image shows the problem, I have a modal where the comments are, notice that there are two with hidden part and do not break the line.

    
asked by anonymous 23.11.2017 / 22:03

1 answer

1

What is in common in the two comments, that there is only 1 word with many characters that exceed the limit of the div, so do not break the line ... but if you still want to break the word at the border of the div use in css:

.comentario-resposta p{
display: block;
position: relative;
width: 50%;
word-wrap: break-word;

}

    
24.11.2017 / 02:30