自定义文本溢出CSS? [英] Custom text-overflow CSS?

查看:100
本文介绍了自定义文本溢出CSS?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道这是可能通过Javascript,因为我自己做。然而,随着我建立的平台越来越大,我想尽可能多的JS重负载。此外,在这个时间点,我认为使用CSS文本溢出属性是更可行的,因为FireFox现在也支持它。



无论如何, MDN上的文字溢出参考页 ,我对第三个参数定义为串。我不知道这是否指text-overflow属性接受字符串值,或者如果它是一个自己的参数(就像剪辑和省略号)。



基本上,我想知道这个字符串参数是否允许我生成一个自定义的文本溢出输出,例如。我已经尝试过:




  • text-overflow:string(..);

  • text-overflow:..;

  • text-overflow:ellipsis-..;


解决方案>

根据MDN文档底部的兼容性表,似乎只有Firefox 9+支持 text-overflow 的字符串值。



那一个。


I am aware this is possible via Javascript, as I have done it myself. However, as the platform I am building up gets bigger and bigger, I want to take as much JS heavy-load as possible. Furthermore, at this point in time, I think using the CSS text-overflow property is much more do-able as FireFox now supports it as well.

Anyhow, reading the text-overflow reference page on MDN, I got curious about that third parameter defined as "string". I do not know whether this refers to "the text-overflow property accepts string values", or if it is a parameter on its own (just like clip and ellipsis).

Essentially, I would just like to know if this string parameter would allow me to generate a custom text-overflow output, such as " ..". I have tried things like:

  • text-overflow: string(" ..");
  • text-overflow: " ..";
  • text-overflow: ellipsis-" ..";

解决方案

Based on the Compatibility Table at the bottom of the MDN documentation, it seems only Firefox 9+ supports a string value for text-overflow.

So, you're mostly out of luck on that one.

这篇关于自定义文本溢出CSS?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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