Chapter 9: Using CSS with SVG
So far, we’ve talked about using CSS with HTML, but we can also use CSS with SVG, or Scalable Vector Graphics. SVG is a markup format for describing flat, two-dimensional images. Because it’s a markup language, it has a Document Object Model, and can be used with CSS.
By using CSS with SVG, we can change the appearance of SVG based on user interaction. Or we can use the same SVG document in multiple places, and show or hide portions of it based on the width of the viewport.
Some of what we’ll discuss here has limited browser support at the time of writing. That may change by the time this book arrives in your hands.
Before we go any further, however, let’s talk about what SVG is and why you should use it.
Vector ...
Get CSS Master, 2nd Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.