标签:order hover wrap ali ext 20px div ips bsp
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Title</title> <style> .divMaxShow:hover { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-decoration: underline; cursor: pointer; color: red; } .divMaxShow { overflow: hidden; /*超过容器长度的截取*/ text-overflow: ellipsis; /*超过容器长度的截取后用省略号代替*/ white-space: nowrap; /*容器内的文本不换行*/ display: block; width: 150px; text-align: center; margin: 5px 20px; font-weight: bold; border: 1px solid red; } </style> </head> <body> <div class="divMaxShow" title="这里是全部的信息没有省略号,理超长文本全部显示">这里是全部的信息,理超长文本显示省略号</div> </body> </html>
标签:order hover wrap ali ext 20px div ips bsp
原文地址:https://www.cnblogs.com/zongli/p/13288674.html