首页
极刻
圈子
教程
开源
登录 / 注册
返回教程:CSS 参考手册
TRY RUN / 在线示例
CSS 参考手册 悬停显示整个文本
CSS 参考手册 悬停显示整个文本
源代码
运行
<!DOCTYPE html> <html> <head> <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>Hover over the two divs below, to see the entire text.</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>
运行结果