JSFiddle - React, Tailwind, and code Playground

HTML

<h3>Longest name that fits will be visible</h3>
<div class="divA">
    <div class="invisible_for_height">&nbsp;</div>
    <div class="divB">
        <div class="under" title="Expectorating">Expectorating</div>
        <div class="divC">&nbsp;</div>
        <div class="divD over">Expectorating</div>
    </div>
</div>

CSS

.under {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    width: 50%;
    position: absolute;
    top: 0;
    right: 0;
    z-index: 1;
}

.over {
    position: relative;
    z-index: 2;
}

.divA {
    width: 20%;
    border: 1px solid #ccc;
    position: relative;
    background-color: #ffc;
    margin: 0 auto;
}

.divB {
    position: absolute;
    top: 0;
    right: 0;
    width: 200%;
    height: 200px;
    background-color: #fcc;
}

.divC {
    width: 50%;
    float: left;
    background-color: #cff;
}

.divD {
    float: left;
    background-color: white;
    background-color: #fcf;
}

.invisible_for_height {
    visiblility: hidden;
}