我需要一个溢出从左边截断,用椭圆 [英] I need an overflow to truncate from the left, with ellipses

查看:140
本文介绍了我需要一个溢出从左边截断,用椭圆的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

简单来说,我有一个字段,其中最右边的数字是最重要的。 (自然地,这个字段来自我们的联盟的系统,基于他们的主键,所以最左边的数字只改变一次每一个时代!)

Briefly, I have a field where the rightmost digits are most significant. (Naturally, this field comes from our affiliates' systems, based on their primary keys, so the left most digits only change once per epoch!)

大家都知道CSS提供了一个使用text-overflow:ellipsis;进行RIGHT截断。如何(不向服务器添加代码通过字符串手术准备该字段)我们截断LEFT上的字段,并将...缺省放在LEFT上?

Everyone knows CSS provides a RIGHT truncation with "text-overflow: ellipsis;". How (without adding code to the server to prepare that field via string-surgery) do we truncate the field on the LEFT, and put the "..." elipses on the LEFT?

(CSS3是好的。)

推荐答案

尝试使用这个技巧:

HTML

<p class="ellipsis">ert3452654546</p>

CSS

.ellipsis
    {
      overflow:hidden;
      width: 60px;
      direction:rtl; 
      margin-left:15px;
      white-space: nowrap;
     }

.ellipsis:after{position:absolute;left:0px; content:"...";}​

FIDDLE

这篇关于我需要一个溢出从左边截断,用椭圆的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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