运行 ❯
获取您
自己的
网站
×
更改方向
保存代码
更改主题,深色/浅色
前往 Spaces
<!DOCTYPE html> <html> <head> <style> #myDIV { border: 1px solid black; background-color: lightblue; width: 175px; white-space: nowrap; overflow: hidden; text-overflow: visible; } </style> </head> <body> <p>Click the "Try it" button to change the text-overflow property of the DIV element:</p> <button onclick="myFunction()">Try it</button> <div id="myDIV"> Lorem ipsum dolor sit amet, consectetuer adipiscing elit,<br> sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.<br> Ut wisi enim ad minim veniam,<br> quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. </div> <script> function myFunction() { document.getElementById("myDIV").style.textOverflow = "ellipsis"; } </script> </body> </html>