Basic syntax text-overflow: clip;ellipsis;string <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title></title> <style type="text/css"> .tf{ width: 100px; height:50px; border:1px solid black; overflow: hidden; text-overflow: clip;/*If you just want to hide the text, it doesn't matter whether you add this sentence or not. height+overflow can directly hide the overflowing text*/ } .tf1{ width: 100px; border:1px solid black; overflow: hidden; text-overflow: ellipsis; -webkit-text-overflow: ellipsis; white-space: nowrap; /*If using ellipsis attribute text-overflow:ellipsis; overflow: hidden;white-space: nowrap; These three attributes are indispensable */ } </style> </head> <body> <div class="tf"> 123WORDPRESS.COM123WORDPRESS.COM123WORDPRESS.COM123WORDPRESS.COM123WORDPRESS.COM123WORDPRESS.COM123WORDPRESS.COM123WORDPRESS.COM123WORDPRESS.COM. </div> <div class="tf1"> 123WORDPRESS.COM123WORDPRESS.COM123WORDPRESS.COM123WORDPRESS.COM123WORDPRESS.COM123WORDPRESS.COM. </div> </body> </html> This concludes this article on a brief analysis of how CSS3 uses text-overflow to solve text typesetting problems. For more relevant CSS3 text typesetting content, please search 123WORDPRESS.COM’s previous articles or continue to browse the following related articles. I hope that everyone will support 123WORDPRESS.COM in the future! |
<<: Combining XML and CSS styles
>>: Solution to inconsistent display of cursor size in input box
Table of contents 1. Overview 1. Explain statemen...
Application software generally has such business ...
Vue's simple timer is for your reference. The...
Based on Vue and native javascript encapsulation,...
This article example shares the specific code of ...
Linux online installation related commands: yum i...
Set Tomcat to automatically start the service: I ...
1 Problem Description This article sorts the esta...
Precautions 1) Add interpreter at the beginning: ...
Question: Although the index has been created, wh...
Preface When I went to an interview at a company ...
The world-famous virtual machine software VMware-...
Table of contents Problem Description Rendering T...
Preface In WEB development, we often involve cros...
Table of contents 1. Effect diagram (multiple col...