Show Output
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>Truncating Long Text with Ellipsis Using CSS</title> <style> p { width: 400px; padding: 10px; background: #f0e68c; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; } </style> </head> <body> <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit ame sem tempor, varius quam at, luctus dui. Mauris magna metus, dapibus nec turpis vel, semper malesuada ante.</p> </body> </html>