JSFiddle - React, Tailwind, and code Playground
by SpiceLab
HTML
<div id="bar_charts">
<div class="chart_container">
<div class="bar red" style="width:65%"></div>
<!-- Ergänzung -->
<span class="text">Text</span>
<span class="number">Zahl (65%)</span>
<!-- Ende Ergänzung -->
</div>
</div>
CSS
#bar_charts {
width:500px
}
.chart_container {
position:relative;
border:1px solid #2f2f2f;
background:white;
padding:10px
}
.chart_container .bar:first-child {
margin-top:0
}
.chart_container .bar {
color:white;
height:15px;
line-height:50px;
text-align:center;
height:50px;
margin-top:10px
}
#bar_charts .red {
background: rgb(248,80,50); /* Old browsers */
background: -moz-linear-gradient(top, rgba(248,80,50,1) 0%, rgba(241,111,92,1) 50%, rgba(246,41,12,1) 51%, rgba(240,47,23,1) 71%, rgba(231,56,39,1) 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(248,80,50,1)), color-stop(50%,rgba(241,111,92,1)), color-stop(51%,rgba(246,41,12,1)), color-stop(71%,rgba(240,47,23,1)), color-stop(100%,rgba(231,56,39,1))); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, rgba(248,80,50,1) 0%,rgba(241,111,92,1) 50%,rgba(246,41,12,1) 51%,rgba(240,47,23,1) 71%,rgba(231,56,39,1) 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, rgba(248,80,50,1) 0%,rgba(241,111,92,1) 50%,rgba(246,41,12,1) 51%,rgba(240,47,23,1) 71%,rgba(231,56,39,1) 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, rgba(248,80,50,1) 0%,rgba(241,111,92,1) 50%,rgba(246,41,12,1) 51%,rgba(240,47,23,1) 71%,rgba(231,56,39,1) 100%); /* IE10+ */
background: linear-gradient(top, rgba(248,80,50,1) 0%,rgba(241,111,92,1) 50%,rgba(246,41,12,1) 51%,rgba(240,47,23,1) 71%,rgba(231,56,39,1) 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f85032', endColorstr='#e73827',GradientType=0 ); /* IE6-9 */
}
/* Ergänzung */
.chart_container span {
display:block;
position:absolute;
top:10px;
z-index:2;
height:15px;
line-height:50px
}
.chart_container .text {
left:15px
}
.chart_container .number {
right:15px
}