twbs / icons

Official open source SVG icon library for Bootstrap.

Home Page:https://icons.getbootstrap.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Q] Empty icon as a spacer for vertical alignment

lonix1 opened this issue · comments

Suppose I have a bootstrap dropdown menu. Each item has an icon, except the first item. Vertically aligning that first item with the others, is a pain.

It would be cool it this were possible:

<span class="bi"></span>

Since no icon was specified, that element would be the same size as other icons, except would be empty. It could be used as a "spacer".

Does someone know if there's a built-in way to do this?

(If this is possible, it might be good to add a little note in the docs too.)

You can build a quick element easily enough I'd assume, even with that .bi class maybe that could set dimensions regardless of the additional icon class.

For anyone else who needs this, my workaround is:

<i class="bi bi-empty"></i>
.bi-empty { display: inline-block; width: 1em; }

If you have a better approach, let me know.