javascript - wrap long text in a div -
I ask for text from a db. If the text is too long, then I want to be able to write 400 characters after the text and at the end I want to display "...". How can this be done?
I recommend that you do not do this in your query. You are probably propagating in a proportionate font, which means that the 400 characters are not the same size. "..." behind it is a little strange with many white spaces.
You can ask the whole field and cut it using CSS (with limited browser support):
overflow: hidden; Text-overflow: oval;
Comments
Post a Comment