css all divs vs direct child divs

后端 未结 3 615
长情又很酷
长情又很酷 2020-12-09 14:36

I have this structure:

ffffdffffdd
pppppppppp
3条回答
  •  轮回少年
    2020-12-09 15:02

    Actually I was searching this:

    Selects the divs that are direct children of Root:

    .Root > div {
        border: 1px solid red;
    }
    

    Selects all the divs under Root:

    .Root div {
        color:green;
    }
    

提交回复
热议问题