How to use and solve the overflow text text-overflow
It is believed that many inexperienced people do not know what to do about the use and solution of overflow text text-overflow. Therefore, this paper summarizes the causes and solutions of the problem. Through this article, I hope you can solve this problem.
Today, when learning to overflow the text text-overflow, I made a mistake, hereby record.
Text-overflow has two attribute values, clip and ellipsis. Clip indicates that the ellipsis mark is not displayed. ), but a simple trimming; ellipsis represents the display of ellipsis marks (… )
It is important to note that for these two attributes to really work, you need to work with overflow:hidden;white-space:nowrap;.
Overflow:hidden; means that parts beyond the text are not displayed.
White-space:nowrap; stands for forcing text to be displayed on one line.
The example code I wrote:
The code is as follows:
Overflow text text-overflow example
Do not show ellipsis marks, but simple trimming
Show ellipsis marks, not simple trimming
Results:
If overflow:hidden; doesn't write, the result looks like this:
If white-space:nowrap; doesn't write, the result looks like this:
After reading the above, have you mastered the use of overflow text text-overflow and how to solve it? If you want to learn more skills or want to know more about it, you are welcome to follow the industry information channel, thank you for reading!