I have a problem with text-overflow: ellipsis - it doesn't want to work with my site. I am currently learning and I have this project in which I have div's with text with fixed height. I tried with text-overflow: ellipsis but I don't seem to be able to make it work. Now my code goes as follows:
<section class="comments">
<p>
Here is a short comment.
</p>
And my CSS is:
.comments p {
height: 40px;
text-align: justify;
text-overflow: ellipsis-word;
line-height: 20px;
word-wrap: break-word;
overflow: hidden;
}
It should work but it doesn't. I have tried to open it with Firefox, Chrome, Opera and IE9 and it works for none of them. I tried to put a style in the <p>
that contains the text, but it didn't help. I tried to change the <p>
to <div>
, and then tried to put a style to the <div>
but it didn't work. I tried with text-overflow: ellipsis only - it didn't work. I tried with text-overflow: clip - it didn't work. Obviously I am making a mistake somewhere but I guess it is too obvious for me to see it. Help!