JSFiddle - React, Tailwind, and code Playground

by Keith Henry

HTML

<div class=example>
    <div class=wrapper>
        <div class=content>

        </div>
    </div>
    not aligned with text
    <div class=wrapper>
        <div class=content>

        </div>
    </div>
</div>

<div class=example>
    <div class=wrapper>
        <a class=content>

        </a>
        &nbsp;
    </div>
    aligned with text
    <div class=wrapper>
        <a class=content>

        </a>
        &nbsp;
    </div>
</div>

CSS

.example {
    line-height: 32px;
    margin: 12px 0;
}

.wrapper {
    display: inline-block;
    height: 24px;
    width: 24px;
    position: relative;
    background-color: red;
    vertical-align:bottom;
}

.wrapper > .content {
    position: absolute;
    bottom: 0;
    right: 0;
    height: 12px;
    width: 12px;
    background-color: blue;
}