Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

Imagine I have such a button:

#btnred{
color:#fd9898;
background:none;
border:none;
cursor:pointer;}

And when I hover on it, the box-shadow appears, but it appears behind the background of the button.

#btnred:hover{
box-shadow:0 0 10px  #605894;
transition:0.4s;}

How do I completely remove the background so that box-shadow appears right behind the text of that button?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
4.2k views
Welcome To Ask or Share your Answers For Others

1 Answer

I think what you want to do is:

  • remove the box-shadow entry in CSS
  • and use text-shadow instead.

See reference: https://css-tricks.com/almanac/properties/t/text-shadow/


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...