运行 ❯
获取您
自己
的网站
×
更改方向
保存代码
更改主题,深色/浅色
前往 Spaces
<!DOCTYPE html> <html> <head> <style> div.a { white-space: nowrap; width: 50px; overflow: hidden; text-overflow: clip; border: 1px solid #000000; } div.b { white-space: nowrap; width: 50px; overflow: hidden; text-overflow: ellipsis; border: 1px solid #000000; } div.c { white-space: nowrap; width: 50px; overflow: hidden; text-overflow: "----"; border: 1px solid #000000; } </style> </head> <body> <h1>The text-overflow Property</h1> <p>The following two divs contains a text that will not fit in the box.</p> <h2>text-overflow: clip (default):</h2> <div class="a">Hello world!</div> <h2>text-overflow: ellipsis:</h2> <div class="b">Hello world!</div> <h2>text-overflow: "----" (user defined string):</h2> <div class="c">Hello world!</div> <p><strong>Note:</strong> The text-overflow: "<em>string</em>" only works in Firefox.</p> </body> </html>