简体   繁体   English

关闭 Angular Material Accordion 的背景阴影?

[英]Turning off the background shadow on Angular Material Accordion?

In this demo I managed to turn off the background shadow on the Angular Material Accordion using this rule: 在此演示中,我设法使用以下规则关闭 Angular Material Accordion 上的背景阴影:


.mat-expansion-panel:not([class*='mat-elevation-z']) {
  box-shadow: none !important;
  /* box-shadow: 0px 3px 1px -2px rgb(0 0 0 / 20%), 0px 2px 2px 0px rgb(0 0 0 / 14%), 0px 1px 5px 0px rgb(0 0 0 / 12%); */
}

I have never seen this type of rule ( [class*=...] ) before.我以前从未见过这种类型的规则 ( [class*=...] )。

Can someone explain what this does?有人可以解释这是做什么的吗?

It's an attribute wildcard selector.它是一个属性通配符选择器。 it looks for any child element under.mat-expansion-panel that has a class that [class*='mat-elevation-z'] element.它会在 .mat-expansion-panel 下查找具有 [class*='mat-elevation-z'] 元素类的任何子元素。

Here are some links that help you more to understand about wildcard selector这里有一些链接可以帮助您更多地了解通配符选择器

  1. http://www.impressivewebs.com/css3-attribute-selectors-substring-matching/ http://www.impressivewebs.com/css3-attribute-selectors-substring-matching/
  2. https://www.w3schools.com/css/css_attribute_selectors.asp#:~:text=CSS%20%5Battribute*%3D%22value%22,to%20be%20a%20whole%20word ! https://www.w3schools.com/css/css_attribute_selectors.asp#:~:text=CSS%20%5Battribute*%3D%22value%22,to%20be%20a%20whole%20word

Thanks!谢谢!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM