Linked Questions
38 questions linked to/from How can I count text lines inside an DOM element? Can I?
-3 votes
1 answer
142 views
Multiline overflow . CSS [duplicate]
Buyer Guarantor: ABC Company RE, Inc. (NewYork) The above text is present in the span as a multiline text. Is there a way in jquery or javascript to check the number of lines present ? in the above ...
1 vote
0 answers
41 views
Find length of line-breaks inside of a HTML element, that are caused by screen-size [duplicate]
I have an element inside my website that is supposed to only show some lines of a string, depending on the size of the element, and size of the screen. In order to do that I need to know how many line ...
27 votes
5 answers
52k views
How to determine a 'line-height' using Javascript (jQuery)? [closed]
Well, encountered the need of a line-height coding a plugin, so, can you give an advice, please? Thanks)
9 votes
6 answers
9k views
Jquery - Truncate Text by Line (not by character count)
I need a Jquery script to truncate a text paragraph by line (not by character count). I would like to achieve an evenly truncated text-block. It should have a "more" and "less" link to expand and ...
18 votes
2 answers
4k views
JavaScript - Get HTML of current line in contentEditable div
I have got my contentEditable div: div { width: 200px; height: 300px; border: 1px solid black; } <div contenteditable="true" spellcheck="false" style="font-family: Arial;"> ...
1 vote
5 answers
8k views
How to count number of lines in javascript html string variable
I have javascript variable with html string data like below format var html_string = '<p class="MsoListParagraph" style="margin-left:28.5pt;mso-add-space:auto;text-indent:-28.5pt;mso-list:l0 ...
10 votes
1 answer
9k views
Determining the number of lines of text in a div in React
I am using the Line-Clamp property (with a backup max-height) to limit the number of lines to show in a React component. I would like to have an optional link afterwards that will expand this content ...
3 votes
2 answers
7k views
Show more based on height in React
I have successfully implemented the show more/show less. My problem is that I want to achieve it based on the number of lines or height of the screen. I don't want it to be based on number of ...
0 votes
1 answer
6k views
Display "Read More" Button based on number of lines in a div
I have a video page with video description. Now I want to show description with 2 lines by default and below the description will be a 'Read More' button. But if the description is less than or equal ...
0 votes
3 answers
3k views
Changing text alignment for each line in multi-line text
In old newspapers, titles of articles would, if they stretched over three lines, often be centered like this (picture): |RACKET KINGPINS | | ARE ROUNDED UP | | IN BOMB KILLING| I.e. ...
0 votes
2 answers
4k views
Show more/less based on number of lines instead of text length
I have the show more/less done but it's based on the length of the text. What happens is, as there are characters that take more space than others, the "show more/less" words show in different places, ...
1 vote
1 answer
4k views
HTML make p tag always 2 lines
I have a game that has a tutorial system. There is a div that contains a p and a continue button. The user will click the continue button multiple times to read new things, and then begin playing the ...
0 votes
2 answers
2k views
How to return number of lines for a p element?
Consider the p element below. <p>A B C D E F G H I J K L M N O P Q R S T U V W X Y Z qwertyuiopasdfghjklzxcvbnm 122333444455555666666777777788888888999999999</p> In my current screen-size,...
1 vote
2 answers
1k views
Counting number of lines of text in a div
I have title and description in my div and I have the requirement that if the title length is more than one line then I have to hide the description using JQuery. <div class="text"> <div&...
0 votes
4 answers
3k views
Check if span element contains more than 3 lines
I'm trying to do a trick with a span element. There is an image attached so that I can explain easier. Left current behavior → Right desired one So the idea is I need to display in the span ...