Cascading Stylesheets have been with us since 1996, making them one of the oldest staples of the Web, even though they only reached widespread popularity with the tables versus CSS wars of the early 2000s.
You're probably familiar with using CSS for styling HTML. So this section will be a refreshing breeze after all that SVG stuff.
My favorite thing about CSS is its simplicity; refer to the following code.
selector { attribute: value; }
And that's it. Everything you need to know about CSS in three lines.
The selectors can get fairly complicated and are beyond the scope of this book.I suggest looking around the Internet for a good guide. We just need to know some basics:
path
: Selects all the<path>
elements.axis
: Selects all the elements with aclass="axis"
attribute.axis line
: Selects all the<line>
elements that are children ofclass="axis"
elements.axis, line
: Selects all theclass="axis"
and<line>
elements
Right now you might be thinking, "Oh hey! That's the...