Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/powershell/12.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
从右侧填充css/javascript输入字段_Javascript_Html_Css - Fatal编程技术网

从右侧填充css/javascript输入字段

从右侧填充css/javascript输入字段,javascript,html,css,Javascript,Html,Css,我怎样才能有一个HTML输入字段,它将接受数字,格式是从右边填充的,就像在Libre Office Calc中一样?(或excell)使用内联样式: <input type="text" style="text-align: right"/> 或者,将其放入样式表中,如下所示: <style> .rightJustified { text-align: right; } </style> .正确的{ 文本对齐:右对齐; } 并引

我怎样才能有一个HTML输入字段,它将接受数字,格式是从右边填充的,就像在Libre Office Calc中一样?(或excell)

使用内联样式:

<input type="text" style="text-align: right"/>

或者,将其放入样式表中,如下所示:

<style>
  .rightJustified {
      text-align: right;
  }
</style>

.正确的{
文本对齐:右对齐;
}
并引用该类:

<input type="text" class="rightJustified"/>

HTML:

CSS:

<input type="text" class="rightJustified"/>
input[type=number]{

    direction:rtl;
}