HTML是否支持剪裁宽度标签? [英] Does HTML support clipping label for width?

查看:96
本文介绍了HTML是否支持剪裁宽度标签?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

HTML中有一个特性,标签有一个特定的宽度,当它需要在给定宽度上渲染时,它应该剪切并显示 ... 。显示完整的实际名称。



类似这样的内容:



解决方案

尝试文本溢出:省略号溢出:隐藏 CSS样式。它们必须一起使用,否则文本溢出将被忽略。所有浏览器(尤其是IE)都可能不支持文本溢出,因此您的测试做得很好。

Is there a feature in HTML that the label has a specific width and when it needs to render over its given width, it should clip and show .... And in the tooltip, the full actual name is shown.

Something like this:

解决方案

Try the text-overflow:ellipsis and overflow:hidden CSS styles. They must be used together, or text-overflow will be ignored.

text-overflow may not be supported in all browsers (esp. IE) so do your testing well.

这篇关于HTML是否支持剪裁宽度标签?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆