JSFiddle - React, Tailwind, and code Playground

by krisselden

HTML

<div class="container">
    <div>My Title</div>
    <hr>
    <div class="left-label-text">
        <span class="label-wrap"><span class="label">Location:</span></span>
        <span class="text">Home</span>
    </div>
    <hr>
    <div class="left-label-text">
        <span class="label-wrap"><span class="label">Address:</span></span>
        <span class="text">1123 1st Ave<br>
        Seattle, WA 98109</span>
    </div>
    <hr>
    <div class="left-label-text">
        <span class="label-wrap"><span class="label">Time:</span></span>
        <span class="text">Nov 1, 2012<br>12pm</span>
    </div>
<hr>
    <div class="left-label-text">
        <span class="label-wrap"><span class="label">Info:</span></span>
        <span class="text">What if I have a lot of text here that people need to read. What if I have a lot of text here that people need to read. What if I have a lot of text here that people need to read.</span>
    </div>
    <hr>
    <div>The quick brown fox jumps over the lazy dog.</div>
</div>

CSS

.container {
    width: 260px;
    padding: 30px;
    background: gray;
    text-align: center;
}

.left-label-text {
    display: inline-block;
    text-align: left;
    position: relative;
}

.label-wrap {
    position: absolute;
    left: 0;
}

.label {
    position: absolute;
    right: 1em;
}

.text {
}