Using input groups (with addons) together with help-text in Bootstrap 4

冷暖自知 提交于 2019-12-24 14:43:49

问题


I'm having a hard time getting Help-texts showing up properly (i.e. at the bottom of the field) with Bootstrap 4's input-groups with add-ons. Here's my code:

<div class="input-group mb-3">
    <div class="input-group-prepend">
        <span class="input-group-text">Title</span>
    </div>
    <textarea class="form-control" name="title" aria-label="With textarea"></textarea>
    <small id="KeywordsHelpBlock" class="input-group-prepend text-muted">
        Some .
    </small>
</div>

Here is what it looks like:

Am I missing something obvious?


回答1:


This has been an issue in Bootstrap 4 for some time. The only way I've found is to add an 100% width empty span to force the wrap...

https://www.codeply.com/go/Rw1ZPnwIcS

<div class="input-group mb-3">
    <div class="input-group-prepend">
        <span class="input-group-text">Title</span>
    </div>
    <textarea class="form-control" name="title" aria-label="With textarea"></textarea>
    <span class="w-100"></span>
    <small id="KeywordsHelpBlock" class=" text-muted">
        Some .
    </small>
</div>


来源:https://stackoverflow.com/questions/48996400/using-input-groups-with-addons-together-with-help-text-in-bootstrap-4

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!