css – input-group-addon class is not present in Bootstrap 4?

css – input-group-addon class is not present in Bootstrap 4?

It looks like you need mandatory wrap icon with <span class=input-group-text><i class=icon-user></i></span> to display it correctly

<div class=input-group>
    <div class=input-group-prepend>
        <span class=input-group-text><i class=icon-user></i></span>
        <input ...>
    </div>
</div>

Here is a link to official Bootstrap 4 migration guide for Input Groups were they say that

We’ve dropped .input-group-addon and .input-group-btn for two new classes, .input-group-prepend and .input-group-append. You must explicitly use an append or a prepend now, simplifying much of our CSS. Within an append or prepend, place your buttons as they would exist anywhere else, but wrap text in .input-group-text.

css – input-group-addon class is not present in Bootstrap 4?

Leave a Reply

Your email address will not be published.