1. 14
  1. 2

    Possibly the best CSS tutorial I’ve read.

    1. 1

      I’m not 100% sure I’ve got this right, but I think the section on specificity might be clearer if it included !important in the tuple, because it doesn’t really override everything, it’s just the highest level of specificity.

      Understanding specificity as taking the rule with the max specificity, where specificity is just a 5-tuple of !important and the number of selectors of each kind is nice, though. That’s very easy to reason about. Thanks for introducing that idea to me!

      1. 1

        Good idea.

        1. 1

          Thinking about it some more, it’s actually a 6-tuple because rule order matters too.

          You don’t say in your guide how order is determined if you have multiple style sheets. I think sheets are ordered based on the timestamp of when the style element or link element is added to the page (rather than distance to the root element in the dom or time that the sheet is parsed (which may be out of order due to async loading)). But again, not sure.

        2. 1

          Here’s a classic from 2005 on specificity: https://stuffandnonsense.co.uk/archives/css_specificity_wars.html

        3. 1

          Finally, I didn’t get into transitions and animations, but I think those are overall less important than

          I think you accidentally a few words ;)

          1. 1

            Whoops! Thanks. :)

            1. 1

              give some of tips and tricks

              And here :)

              So good I’m reading again ;)