【问题标题】:Angular: Is there any way to add rupee prefix to bootstrap input field?Angular:有没有办法在引导输入字段中添加卢比前缀?
【发布时间】:2019-11-19 11:56:50
【问题描述】:

这是我的html 文件。我想在我的输入字段中添加 前缀。我正在开发一个 Angular 项目并将 botstrap 用于 html 页面。 product.component.html

<form>
    <div class="form-group">
        <label for="title">Title</label>
        <input id="title" type="text" class="form-control">
    </div>
    <div class="form-group">
            <label for="price">Price</label>   <==Want to add here
            <input id="price" type="number" class="form-control">
    </div>
    <div class="form-group">
            <label for="category">Category</label>
            <select id="category"class="form-control">
                <option value=""></option>
            </select>
    </div>
    <div class="form-group">
            <label for="imageUrl">Image Url</label>
            <input id="imageUrl" type="text" class="form-control">
    </div>
    <button class="btn btn-primary">Save</button>
</form>

【问题讨论】:

标签: angular bootstrap-4


【解决方案1】:

我猜你正在寻找这个。

使用 input-group 类来添加和添加文本/图标。

代码:

<div class="form-group">
    <label for="price">Price</label>
    <div class="input-group">
        <div class="input-group-prepend">
            <div class="input-group-text">₹</div>
        </div> 
        <input id="price" type="number" class="form-control">
    </div>
</div>

参考

Bootstrap 4 Input group

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2015-05-12
    • 1970-01-01
    • 2021-10-17
    • 2015-10-21
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-10-29
    相关资源
    最近更新 更多