Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/38.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Css matRipple的背景色_Css_Angular_Angular Material - Fatal编程技术网

Css matRipple的背景色

Css matRipple的背景色,css,angular,angular-material,Css,Angular,Angular Material,如果我使用文本,所有内容都会变成红色,我无法再阅读文本 有没有办法只将背景变成红色而不将文本变成红色?您需要使用绝对位置和z-index:1作为文本值 <span matRipple matRippleColor="red"> <span style="position:absolute; z-index:1">Text</span> </span> 文本

如果我使用
文本
,所有内容都会变成红色,我无法再阅读文本


有没有办法只将背景变成红色而不将文本变成红色?

您需要使用绝对位置和z-index:1作为文本值

<span matRipple matRippleColor="red">
  <span style="position:absolute; z-index:1">Text</span>
</span>

文本