溢出向左而不是右(Overflow to left instead of right)

编程入门 行业动态 更新时间:2024-10-27 02:21:09
溢出向左而不是右(Overflow to left instead of right)

我有一个overflow:hidden的div overflow:hidden ,里面显示一个电话号码,用户键入它。 div内的文本与右对齐,随着文本向左增加,传入的字符被添加到右边。

但一旦文字大到不能适应div,数字的最后一个字符就会自动裁剪,用户看不到她输入的新字符。

我想做的是裁剪左边的字符,就像div显示最右边的内容,并且溢出到左边。 如何创建这个效果?

I have a div with overflow:hidden, inside which I show a phone number as the user types it. The text inside the div is aligned to right and incoming characters are added to right as the text grows to left.

But once the text is big enough not to fit in the div, last characters of the number is automatically cropped and the user cannot see the new characters she types.

What I want to do is crop the left characters, like the div is showing the rightmost of its content and overflowing to the left side. How can I create this effect?

最满意答案

您尝试使用以下方法:

direction: rtl;

有关更多信息,请参阅 http://www.w3schools.com/cssref/pr_text_direction.asp

Have you tried using the following:

direction: rtl;

For more information see http://www.w3schools.com/cssref/pr_text_direction.asp

更多推荐

div,字符,characters,left,电脑培训,计算机培训,IT培训"/> <meta name="descri

本文发布于:2023-08-07 13:14:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1464188.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:而不是   Overflow   left

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!