css を使用してこの進行状況バーをシミュレートしようとしています。これには 2 つの背景があり、背景の 1 つはテキストの後ろのバーの一部のみを覆う必要があります。その幅は、% を変更するために簡単に操作できる必要があります。私は完全なバーから始めましたが、パーセンテージ部分を追加する方法が本当にわかりません. 絶対配置なしで行うことは可能ですか?
<div class="bar">
Progress: 60%
</div>
.bar {
border: 1px solid black;
color: white;
display: table-cell;
width: 250px;
height: 50px;
text-align: center;
vertical-align: middle;
background: #003458;
background: -moz-linear-gradient(top, #003458 0%, #001727 100%);
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#003458), color-stop(100%,#001727));
background: -webkit-linear-gradient(top, #003458 0%,#001727 100%);
background: -o-linear-gradient(top, #003458 0%,#001727 100%);
background: -ms-linear-gradient(top, #003458 0%,#001727 100%);
background: linear-gradient(to bottom, #003458 0%,#001727 100%);
}