Home  >  Article  >  Web Front-end  >  css implements text overflow and display ellipses without wrapping

css implements text overflow and display ellipses without wrapping

藏色散人
藏色散人Original
2020-11-20 11:16:125821browse

How to implement css text without line wrapping and displaying ellipses over overflow: first open the css style sheet; then use the attribute "white-space: nowrap;" to force the text to not wrap; then use "text-overflow:ellipsis;" Just implement text overflow and display ellipses.

css implements text overflow and display ellipses without wrapping

Recommended: "css video tutorial"

1. Not mandatory Line wrap

  • white-space: nowrap; The text is forced not to wrap;

  • text-overflow:ellipsis; The text overflows and displays ellipsis;

  • overflow:hidden; Hide the overflow part;

2. Automatic line wrapping

  • word-wrap: break-word;

  • word-break: normal;

3. Force English word line break

word-break: break-all;

The above is the detailed content of css implements text overflow and display ellipses without wrapping. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn