Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
CSS でスタイル設定された HTML ページに埋め込みたい SVG 画像がたくさんあります。
SVG の要素の色を、親 HTML 要素の color 属性から継承できるようにしたいと考えています。
設定してみstyle="stroke: none; fill: inherit"ましたが、うまくいきません。
style="stroke: none; fill: inherit"
HTML は色を使用しますが、SVG は塗りと線を使用します。currentColor次のような値を使用して、塗りつぶしまたはストロークを取得して、カラーCSSプロパティの値を使用できます。fill="currentColor"
currentColor
fill="currentColor"