JSFiddle - React, Tailwind, and code Playground
by Keith Jeter
HTML
<div class="supa_rappa">
<div class="rappa">
<span class="lefty">Lefty One</span>
<span class="righty">RightyRighty</span>
<div class="dot_bottom"></div>
</div>
<div class="rappa">
<span class="lefty">Lefty Two</span>
<span class="righty">RightyRightyRightyRightyRightyRightyRightyRightyRightyRightyRightyRightyRightyRightyRightyRightyRightyRightyRightyRighty</span>
<div class="dot_bottom"></div>
</div>
<div class="rappa">
<span class="lefty">Lefty Three</span>
<span class="righty">RightyRightyRightyRightyRightyRightyRightyRightyRightyRightyRighty</span>
<div class="dot_bottom"></div>
</div>
</div>
SCSS
body { background: red; }
.supa_rappa {
display: block;
float: left;
background: #fff;
padding: 10px;
width: 50%;
margin: 20px;
overflow-wrap: white-space;
}
.rappa {
display: flex;
flex-direction: column;
position: relative;
/* display: flex; */
float: left;
width: 100%;
min-height: 38px;
height: auto;
background: #fff;
margin-bottom: 15px;
/* margin: 0 15px 10px 15px; */
&:last-child {
margin-bottom: 0;
}
}
.lefty {
position: absolute;
font-weight: bold;
/* height: 30px; */
left: 0;
bottom: -1px;
z-index: 2;
margin-top: -4px;
background: #fff;
padding: 0 10px 0 0;
}
.righty {
position: relative;
white-space: normal;
word-break:break-word;
float: right;
z-index: 2;
text-align: right;
min-width: 38px;
max-width: 190px;
height: auto;
margin-top: auto;
align-self: flex-end;
background: #fff;
padding-left: 10px;
}
.dot_bottom {
position: absolute;
width: 100%;
border-bottom: dotted 2px #000;
height: 23px;
bottom: 2px;
}