2015-11-24 46 views
-1

我有一个输入标记和一个货币符号。 在进入任何数字或退格,我想货币符号和金额为中心对齐是货币符号应左,右移动相应将货币符号移至每个输入的左侧并保持对齐

附加代码和截图

<div class="input"> 
    <div class="a"> 
     <span>₹</span> 
     <input class="inActive" id="v" value="" type="number" required> 
    </div> 
    </div> 

要求的结果: - enter image description here

+3

预计您至少会尝试为自己编写代码。堆栈溢出不是代码写入服务。我建议你做一些额外的研究,无论是通过谷歌或通过搜索,做一个尝试和。如果您仍然遇到麻烦,请返回**您的代码**并解释您尝试过的以及为什么它不起作用。 –

回答

0

也许你可以使用引导程序和做这样的事情

<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css" rel="stylesheet"/> 
 
<div class="input-group"> 
 
     <span class="input-group-addon">₹</span> 
 
     <input type="text" class="form-control" aria-label="Amount (to the nearest dollar)"> 
 
</div>

它会将您的符号放在输入左侧的加载项中。

+0

要访问,输入需要一个合适的标签元素,其内容比“金额”更多。这对其他人也会更有帮助。 ;-) – RobG

+0

这个问题是近似和粗糙的,我的答案也是如此。希望你能理解它。他要求设计,我告诉你一个办法。 :) – JonathanG