Home
CSS
CSS Text Effects
Tryit: Using the text-overflow property
Run ❯
Get your
own
website
Result Size:
625 x 534
×
Change Orientation
Save Code
Change Theme, Dark/Light
Go to Spaces
<!DOCTYPE html> <html> <head> <style> p.test1 { white-space: nowrap; width: 200px; border: 1px solid #000000; overflow: hidden; text-overflow: clip; } p.test2 { white-space: nowrap; width: 200px; border: 1px solid #000000; overflow: hidden; text-overflow: ellipsis; } </style> </head> <body> <h1>The text-overflow Property</h1> <p>The following two paragraphs contains a long text that will not fit in the box.</p> <h2>text-overflow: clip:</h2> <p class="test1">This is some long text that will not fit in the box</p> <h2>text-overflow: ellipsis:</h2> <p class="test2">This is some long text that will not fit in the box</p> </body> </html>