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

Popular posts from this blog

c++ - QtQuick: QQmlApplicationEngine failed to load component qrc:/main.qml:23 Invalid attached object assignment -

sql - dynamically varied number of conditions in the 'where' statement using LINQ -

php - What is the best way to get the URL of a 404'd file after redirect? -