1

So I looked at how CSS "shares" its properties here : https://stackoverflow.com/a/199719/13707884

This was written in 2008 so I figured maybe CSS does allow for inheritance now & sure enough there is an article on it here : https://coderwall.com/p/lqjd1w/css-class-inheritance-in-css

So I am trying out the code as mentioned in the link on "coderwall":

[class*=“row-“] { border: 5px solid lightskyblue; } .row-1 { color: blue; } .row-2 { color: darkred; }
<div class="row-1">AAA</div> <div class="row-2">AAA</div>

However, this does not seem to be working. What could I be doing wrong here?

0

    1 Answer 1

    4

    Your quotation marks in your first selector are invalid.

    [class*="row-"] { border: 5px solid lightskyblue; } .row-1 { color: blue; } .row-2 { color: darkred; }
    <div class="row-1">AAA</div> <div class="row-2">AAA</div>

    1
    • thanks for the response. As I mentioned earlier the error was in the original blog posting that used the quotation marks (however, someone is kind enough to delete the comments for some reason).
      – Arthur W
      CommentedJun 6, 2021 at 13:13

    Start asking to get answers

    Find the answer to your question by asking.

    Ask question

    Explore related questions

    See similar questions with these tags.