← 静的パーツギャラリーへ戻る

パーツ番号 09-10-04 ・ CSSのみ

半円メーター(ゲージ風)

速度計のような半円形で数値を示す静止メーターです。スコア表示やパフォーマンス指標に利用できます。

staticcss

プレビュー

ソースコード

HTML

<div class="gaugewrap">
          <svg viewBox="0 0 120 68" width="160" height="90">
            <path d="M10,62 A50,50 0 0,1 110,62" fill="none" stroke="#e5e7eb" stroke-width="10" stroke-linecap="round"/>
            <path d="M10,62 A50,50 0 0,1 110,62" fill="none" stroke="#f59e0b" stroke-width="10" stroke-linecap="round"
              stroke-dasharray="157.08" stroke-dashoffset="50.3"/>
          </svg>
          <div class="gaugeval">68<span>%</span></div>
        </div>

CSS

.d09-10-04 .gaugewrap{text-align:center}
        .d09-10-04 svg{display:block;margin:0 auto}
        .d09-10-04 .gaugeval{margin-top:-10px;font-size:24px;font-weight:700;color:#1e293b}
        .d09-10-04 .gaugeval span{font-size:13px;color:#94a3b8;margin-left:2px}

クラス名 .d09-10-04 は本ライブラリ内での識別用です。複数のパーツを同じページで使う場合は、重複しないよう名前を変更してください。