setting font color of inside a li tag

后端 未结 9 1585
臣服心动
臣服心动 2021-02-20 07:26

My markup looks like:


I want th

9条回答
  •  情歌与酒
    2021-02-20 07:42

    Use the following rule:

    div.c1 li.c2 a {
        color: red;
    }
    

    This matches a tags inside of li tags with class c2 inside of div tags with class c1.

    For added uniqueness, you might want to give the a tag its own class name.

    Also, li tags should only appear inside of list tags. (ul or ol).
    Did you mean

  • ?

提交回复
热议问题