html+css 如何让下图文字部分超出的部分用省略号表示。

border: 1px solid red; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;} 111111111111111111 1111111111111111111111 主要是用到text-overflow: ellipsis;这个属性。white-space: nowrap阻止默认换行...
html+css 如何让下图文字部分超出的部分用省略号表示。
<!doctype html><html lang="en"> <head> <meta charset="UTF-8"> <meta name="Generator" content="EditPlus®"> <meta name="Author" content=""> <meta name="Keywords" content=""> <meta name="Description" content=""> <title>Document</title> <style> .main{ width: 100px; border: 1px solid red; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;} </style> </head> <body><div class="main"> 111111111111111111 1111111111111111111111</div> </body></html>主要是用到text-overflow: ellipsis;这个属性。white-space: nowrap阻止默认换行。结合起来可以了。
实惠家装·香瑞装饰为您解答。
2017-07-30
mengvlog 阅读 8 次 更新于 2025-07-20 15:32:10 我来答关注问题0
檬味博客在线解答立即免费咨询

CSS相关话题

Copyright © 2023 WWW.MENGVLOG.COM - 檬味博客
返回顶部