JSFiddle - React, Tailwind, and code Playground

by Agostino Pesapane

HTML

<div class="container">
    <div>Foo</div>
</div>

<div class="container">
    <span>Foo</span>
</div>

<div class="container">
        <input value="Foo" />
</div>

<div class="container">
    <button>Foo</button>
</div>

CSS

.container {
    position: relative;
    height: 100px;
    background-color: lightblue;
}

.container > * {
    background-color: #FAA;
    bottom: 5px;
    left: 5px;
    position: absolute;
    right: 250px;
    top: 5px;

    /* This is important to give a maximum width
       to all elements inside container */
    width:100%;
    max-width:500px;
}

/* Remove border from input box to be perfectly aligned
   to other elements */

input{
    border:0;
}