2021年2月5日星期五

Why does the "body[attribute="value] element" CSS selector doesn't work? [duplicate]

Why don't these CSS selector work ? The browser doesn't even detect these rules so nothing is applied.

body[color-theme="light"] ion-input {    --background: rgb(240, 240, 240);  }    body[color-theme="dark"] ion-input {    --background: #1e1e1e;  }  

My HTML looks like this :

enter image description here

If I only use the ion-input CSS selector though it works, so it seems that the body[color-theme="dark"] cause a problem.

https://stackoverflow.com/questions/66072695/why-does-the-bodyattribute-value-element-css-selector-doesnt-work February 06, 2021 at 09:23AM

没有评论:

发表评论