菜鸟学堂
在线运行
源代码
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>菜鸟学堂(edu.jb51.net)</title> <style> div.test { white-space:nowrap; width:12em; overflow:hidden; border:1px solid #000000; } div.test:hover { text-overflow:inherit; overflow:visible; } </style> </head> <body> <p>鼠标移动到框内,查看效果t.</p> <div class="test" style="text-overflow:ellipsis;">This is some long text that will not fit in the box</div> <br> <div class="test" style="text-overflow:clip;">This is some long text that will not fit in the box</div> </body> </html>
运行结果
在线运行
菜鸟学堂 edu.jb51.net