[英]Add space (like letter spacing) after some amount of characters
Given an Input field 给定输入字段
<input type="text" />
Type in somer Numbers 000000000000 输入一些数字000000000000
Now the desired result is: 000 000 000 000 现在所需的结果是:000000000000000
There is no way to do this right now in CSS
is there? CSS
现在没有办法做到这一点吗?
No, not in css, but it's simple in JS or PHP Justinas 不,不是在CSS中,但是在JS或PHP Justinas中很简单
No, there isn't. 不,没有。 You'll need some RegEx and JS. 您将需要一些RegEx和JS。 BenM 本
With pure CSS it is not possible. 使用纯CSS是不可能的。 Rahul Tripathi 拉胡尔·特里帕蒂(Rahul Tripathi)
With pure CSS it is not possible. 使用纯CSS是不可能的。 However if you are using PHP or Javascript then you can have it. 但是,如果您使用的是PHP或Javascript,则可以使用它。 Like for example in PHP you can try like this: 例如在PHP中,您可以这样尝试:
<?php
$str = "000000000000";
echo chunk_split($str, 3, ' ');
On a side note: 附带说明:
You can also check about letter-spacing which is used to give space after every character in CSS. 您还可以检查字母间距 ,该间距用于在CSS中的每个字符之后提供空格。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.