Home > Articles

Styling SVG

  • Print
  • + Share This
This chapter is from the book

This chapter is from the book

Q&A

  1. This chapter has suggested creating a class for every style declaration. This would seem to create a long style sheet to accommodate every possible declaration. Are other methods possible?

  2. Certainly. The author has made this suggestion based on his experience developing SVG with a team of developers. Other methods are possible and equally beneficial (if not more, in some cases), and you are encouraged to code your style sheets in a fashion that best suits your team and work environment. In some cases, grouping several declarations into one class can be quite helpful. For instance, if you were to create a class labeled "errormsg" to style text that appeared whenever a user did something wrong, you could place several declarations inside to create your effect: a red fill, 24-point underlined text, Arial Bold typeface, and so on. Whatever you choose, try out competing methods and see what works best for you.

  3. I would like to learn more about CSS. What resources are available?

  4. You can read the W3C's CSS2 recommendation online at http://www.w3.org/TR/REC-CSS2. The W3Schools' site also features a tutorial at http://www.w3schools.com/css/default.asp.

  • + Share This
  • 🔖 Save To Your Account