From 1de75f22f8cb168de6cef16bfd81180a68c34f07 Mon Sep 17 00:00:00 2001 From: Rob Levin Date: Sun, 2 Jun 2019 10:48:01 -0700 Subject: [PATCH] [CSS] Mention presentational attribute specificity vs. CSS in SVG question (#196) --- questions/css-questions.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/questions/css-questions.md b/questions/css-questions.md index 6be7bd3e2..5a1072fb4 100644 --- a/questions/css-questions.md +++ b/questions/css-questions.md @@ -235,6 +235,8 @@ Basic coloring can be done by setting two attributes on the node: `fill` and `st fill="purple" fill-opacity="0.5" stroke-opacity="0.8"/> ``` +The above `fill="purple"` is an example of a _presentational attribute_. Interestingly, and unlike inline styles like `style="fill: purple"` which also happens to be an attribute, presentational attributes can be [overriden by CSS](https://css-tricks.com/presentation-attributes-vs-inline-styles/) styles defined in a stylesheet. So, if you did something like `svg { fill: blue; }` it would override the purple fill we've defined. + ###### References * https://developer.mozilla.org/en-US/docs/Web/SVG/Tutorial/Fills_and_Strokes