Having a basic HTML question. I wrote the following question:
<div class="low">
<div class="chart">
<div class="cover-fill" style="width: 91%"></div>
<div class="cover-empty" style="width: 9%"></div>
</div>
</div>
The css:
.low .chart { border: 1px solid #C21F39 }
.medium .chart { border: 1px solid #666; }
.high .chart { border: 1px solid rgb(77,146,33) }
.low .cover-fill { background: #C21F39 }
.medium .cover-fill { background: #666; }
.high .cover-fill { background: rgb(77,146,33) }
.cover-fill, .cover-empty {
display:inline-block;
height: 15px;
}
.chart {
line-height: 0;
}
.cover-full {
border-right: none !important;
}
I basically creates the following bar:
I would like to add numbers in the center of the bar itself. The wanted result is:
I tried to use the <p>
tag in the chart div
but it didn't work. What CSS should I use in order to make it work?