title: css根据子元素为父级设置样式
id: 12ba7ef3-cc9a-452c-af6e-a9c520e2b1cf
date: 2024-03-27 14:33:24
auther: 18340057286
cover:
excerpt: divhas(p) { background-color yellow; }
permalink: /archives/cssgen-ju-zi-yuan-su-wei-fu-ji-she-zhi-yang-shi
categories:

  • css

    tags:

`

div:has(p) {

background-color: yellow;

}

`