-1

.text-shadow {
  text-shadow: 8px 12px 0px 0px rgba(0, 0, 0, 0.5);
}
<h1 class="text-shadow">hallo</h1>

it doesn't show a shadow and it also doesn't apply on the class

enter image description here

This is what the browser respond

can someone help me to fix the problem so the shadow work

I also tried it with filter: drop-shadow but it also doesn't work But other filters like blur work

Sfili_81
  • 2,377
  • 8
  • 27
  • 36
rich-ad
  • 3
  • 1
  • 1
    [https://developer.mozilla.org/en-US/docs/Web/CSS/text-shadow?retiredLocale=it](https://developer.mozilla.org/en-US/docs/Web/CSS/text-shadow?retiredLocale=it) Read the docs... i think you use 5 properties instead of 4 – Sfili_81 Aug 01 '23 at 09:51
  • The crossed-out value indicates that the value you specified is invalid, and hovering over the triangle would have also told you that ... So go read up on the correct syntax. (Which you really rather could have done before you came asking, btw.) – CBroe Aug 01 '23 at 09:55

2 Answers2

1

Your text-shadow was incorrect.
Text-shadow doesn't take 5 options.
You should apply 2px 2px rgba(0, 0, 0, 0.5) or 2px 2px 2px rgba(0, 0, 0, 0.5).

:offset-x | offset-y | blur-radius | color

.text-shadow {
  text-shadow: 2px 2px 2px rgba(0, 0, 0, 0.5);
}
<h1 class="text-shadow">hallo</h1>
Webdeveloper_Jelle
  • 2,868
  • 4
  • 29
  • 55
  • 2
    Text-shadow can't take 5 options but 4 yes :offset-x | offset-y | blur-radius | color. I think you have a typo in your answer :) – Sfili_81 Aug 01 '23 at 09:54
0

You have an invalid property value for text-shadow.

This property is specified as a comma-separated list of shadows.

Each shadow is specified as two or three 'length' values, followed optionally by a 'color' value. The first two 'length' values are the 'offset-x' and 'offset-y' values. The third, optional, 'length' value is the 'blur-radius'. The 'color' value is the shadow's color.

I am guessing that you don't want blur, so remove the two 0px values.

.text-shadow{
    text-shadow: 8px 12px rgba(0, 0, 0, 0.5);
}
<h1 class="text-shadow">hallo</h1>
Tim R
  • 2,622
  • 1
  • 3
  • 19