JSFiddle - React, Tailwind, and code Playground
HTML
<div class="outer">
<div class="inner rotate">Centered?</div>
</div>
<div class="outer">
<div class="inner">Centered?</div>
</div>
<div id='controls'>
<p><b>Height:</b><br/>
<input id='height' type="range" min=20 max=300 value=150 />
</p>
</div>
CSS
#controls {
position: absolute;
left: 200px;
top: 10px;
border: 1px solid gray;
padding-left: 10px;
padding-right: 10px;
background: #f8f8f8;
}
.outer {
background-color: pink;
width: 16px;
position: relative;
display: inline-block;
margin-right: 10px;
}
.inner {
font-size: 13px;
font-color: #878787;
position: absolute;
top: 50%;
margin-top: -7px;
}
.rotate {
-webkit-transform: rotate(-90deg);
-ff-transform: rotate(-90deg);
transform: rotate(-90deg);
width: 16px; /* transform: rotate() does not rotate the bounding box. */
}
JavaScript
$('#height').on('change', function(e) {
$('.outer').css('height', $('#height').val() + 'px');
});
$('#height').trigger('change');