Ask Sawal

Discussion Forum
Notification Icon1
Write Answer Icon
Add Question Icon

sixylm Agrawal




Posted Questions



Wait...

Posted Answers



Answer


So your designer has asked you to add the three dots at the end when the text doesn't fit, and you have no clue how to do that?

Don't worry, it's super simple to do with CSS.

By the way, those three dots at the end are called ellipsis.

Real quick - would you like to master CSS and learn Web Development? If so, be sure to check out the platform I recommend to learn coding online:

Use text-overflow: ellipsis; to automatically truncate the text when it overflows the container and add the three dots at the end.

The element needs to get resized and the text has to stay in one line for the ellipsis to show up, so here are all 3 CSS lines you need:

You will soon find, that text-overflow: ellipsis; doesn't work when the text wraps to an extra line.

To truncate multi-line text and add an ellipsis at the end of the last line use the experimental -webkit-box box model (don't worry it's supported in all major browsers):

Control how many lines to show with -webkit-line-clamp. It is important to let the text wrap by setting the white-space property to pre-wrap or normal.

It's trivial to truncate the overflowing text and add an ellipsis at the end of a single line. Adding an ellipsis for multiline text is a bit more tricky, so this post should help you.

You can find the code examples for this article on my GitHub: https://github.com/vincaslt/twitter-code/tree/main/src/ellipsis

Since you're learning CSS tricks, why not go through my practical CSS guide? It will take only 5 minutes, but it will teach you all of the CSS you need in practice:


Answer is posted for the following question.

how to ellipsis text css?

Answer


  1. Dial the speed code *170#
  2. Reply with 7 to access mobile your money wallet.
  3. Select option 5 for airtime reversal.
  4. Put the amount of transaction to be reversed.
  5. Then enter 1 for executing process reversal.
  6. You will receive confirmation SMS for a successful reversal.

Answer is posted for the following question.

How to reverse mtn evd credit transfer?

Answer


  1. Press the V key on the TV remote.
  2. Select System from the menu.
  3. Then select Check for Updates.
  4. The TV will start checking for updates.
  5. If a new update is available, confirm you want to install it and wait for the process to complete.

Answer is posted for the following question.

How to update my vizio tv?

Answer


  • Third-Party Liability Only Cover. Under this type of car insurance coverage, you will get the following benefits: .
  • Collision Damage or Own Damage (OD) Cover.
  • Personal Accident Cover: .
  • Zero Depreciation Insurance: .
  • Comprehensive Car Insurance:

Answer is posted for the following question.

What are the categories for car insurance?


Wait...