Andrey (azangru) wrote,

CSS at its worst — when the order in which the rules are defined in a stylesheet matters, because, given the same selector specificity, the latest defined selector wins.

E.g. given this html structure:

If the child-foo class is defined after the child class, the border will have one color:

But if the child-foo class is defined before the child class, the border will have a different color:

And I was certain — certain — that given that the child-foo class if declared after the child class in the html class attribute, the child-foo will always win. But no, CSS reminded me today about its weirdness.

  • (no subject)

    com-petere со-ревновать-ся

  • (no subject)

    Someone is actually running a youtube ad campaign targeting React developers with a course on becoming a UI architect: The site that the ad…

  • (no subject)

    A beautiful cartoon on the front page of The Week:

  • Post a new comment


    default userpic
    When you submit the form an invisible reCAPTCHA check will be performed.
    You must follow the Privacy Policy and Google Terms of use.