css n number of lines only

.class{
   word-break: break-word;
   overflow: hidden;
   text-overflow: ellipsis;
   display: -webkit-box;
   line-height: 16px; /* fallback */
   max-height: 32px; /* fallback */
   -webkit-line-clamp: 2; /* number of lines to show */
   -webkit-box-orient: vertical;
}

3.67
6

                                    .className{
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;

   line-height: 16px; /* Height taken by one line */
   max-height: 32px; /* (line-height * numberOfLineYouWant) In this case we want 2 lines so we will multiply lineHeight by 2 so 16 * 2 = 32 => 32px */
						/* Remember if you have more height then it'll render new line so match height of container with => lineHeight * numberOfLines */
}

3.67 (6 Votes)
0
Are there any code examples left?
Create a Free Account
Unlock the power of data and AI by diving into Python, ChatGPT, SQL, Power BI, and beyond.
Sign up
Develop soft skills on BrainApps
Complete the IQ Test
Relative searches
css set number of lines css text get number of lines css text max rows css paragraph max lines paragraph with max number of lines css max lines show ellipsis after text length css limit text to two lines and add ellipsis line scoutn css3 css limit size of paragraph lines css limit text length only show limited amount of lines in text css 2line read more text css text number of lines max lines html limit a content in a block css max rows css how to limit text in 2 line without breaking words in css set max number of lines css css count text lines to display line limit css css maxlines css max lines ellipsis limit text to 3 lines css text max lines html css css limit rows css n number of lines only css limit text wrap to two lines css line limit css text line limit limit words css limit text to 2 lines css p tag max lines css keep text to max two lines set the number of lines for ellipsis limit text length in div more to next line limit numbers in css elipse rows max-lines is not working on chrome limit text length css max height text overflow text maximu 3 lines height html text 3 line css max line javascript limit text to two lines jquery limit text to two lines css in to lines how to limit what is shown css how to limit text length in css css more for text imit css text length max line number css limit lines of text css show ellipsis after text length in input box excerpt text css 2 lines css text max 2 lines css restrict text length horizontal div limit text length max text lines overflow css 3 line show css how to make nice full text lines css if more than one line then end with ... in css css div max 2 lines of text how to show specific amount of multiline text in html css image max height css limit paragraph css restrict paragraph height in css css text overflow max lines
Made with love
This website uses cookies to make IQCode work for you. By using this site, you agree to our cookie policy

Welcome Back!

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign in
Recover lost password
Or log in with

Create a Free Account

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign up
Or sign up with
By signing up, you agree to the Terms and Conditions and Privacy Policy. You also agree to receive product-related marketing emails from IQCode, which you can unsubscribe from at any time.
Creating a new code example
Code snippet title
Source