Welcome toVigges Developer Community-Open, Learning,Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
4.1k views
in Technique[技术] by (71.8m points)

How do I fully remove background from the <button> in CSS?

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?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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/


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to Vigges Developer Community for programmer and developer-Open, Learning and Share
...