I have a DIV with a multi-line paragraph.
Is there any way (maybe using jQuery) to only show the first line of the paragraph and hide the others?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
There is not an outright way to do this by specifying the first line.I would suggest changing the height of the DIV using CSS to only show the first line. It would seem to me to be the simplest solution. If you then want to change to show the whole line with javascript just use it to change the height of the DIV back to 100%.EDIT: I stand corrected, I was not aware that there was a first-line pseudo class. However changing the height may still be the simplest way.