Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSS

how to color svg with css

<!-- If you want to change te color of an svg element with CSS, the best way
to do it is by targeting the individual elements used inside the svg. See 
example below: -->

<!DOCTYPE html>
<html>
  <head>
    <style>
      circle {
        stroke: yellow;
        fill: red;
      }
      line {
      	stroke: blue;
      }
    </style>
  <body>
    <svg>
      <g>
        <line x1="18" y1="6" x2="6" y2="18"/>
        <circle cx="50" cy="50" r="40"/>
  </body>
</html>
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #color #svg #css
ADD COMMENT
Topic
Name
4+7 =