The principle is very simple, text-shadow is always under the font, so use text-shadow's multiple shadows to first simulate the effect of embedded shadows under the solid color of the font, and then, by changing the transparency of the font Lower it to simulate the shadow within the font. Of course, this kind of simulation has limitations. For example, the background color and simulated shadow must be the same, otherwise it will be confusing, haha. Secondly, it will not work in browsers that do not support RGBA, and a default color must be added on top of RGBA to ensure that old browsers can at least display solid colors:
Finally, if you select the above paragraph The text of the example is clearly blurred. This has been mentioned before, because the effect of multiple shadows is still effective when selected, so for the readability of the text, the text shadow when selected should be removed.
The key point is to use RGBA transparent color to simulate the inner shadow effect of the font.
The principle is very simple, text-shadow is always under the font, so use text-shadow's multiple shadows to first simulate the effect of embedded shadows under the solid color of the font, and then, by changing the transparency of the font Lower it to simulate the shadow within the font. Of course, this kind of simulation has limitations. For example, the background color and simulated shadow must be the same, otherwise it will be confusing, haha. Secondly, it will not work in browsers that do not support RGBA, and a default color must be added on top of RGBA to ensure that old browsers can at least display solid colors:
Finally, if you select the above paragraph The text of the example is clearly blurred. This has been mentioned before, because the effect of multiple shadows is still effective when selected, so for the readability of the text, the text shadow when selected should be removed.