CSS 按键内发光效果

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/4625058/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-29 23:26:09  来源:igfitidea点击:

Inner glow effect of button

css

提问by rashmi

I want to have inner glow effect of button when focused. I could achieve outline (outer) glow of button but I even want to have inner glow effect. Could anyone help?

我想在聚焦时有按钮的内部发光效果。我可以实现按钮的轮廓(外)发光,但我什至想要有内发光效果。有人可以帮忙吗?

回答by thirtydot

I made a jsFiddleshowing this effect:

我做了一个jsFiddle 来展示这个效果:

a {
    -webkit-box-shadow: inset 0 0 30px #00f;
    -moz-box-shadow: inset 0 0 30px #00f;
    box-shadow: inset 0 0 30px #00f;
}


Edit:in response to your comment: Here's a much sexier version.

编辑:回应您的评论:这是一个更性感的版本

回答by crodjer

use box-shadowinset:

使用box-shadowinset

.class{
  box-shadow:inset 2px 2px 2px 2px black;
}

http://www.css3.info/preview/box-shadow/

http://www.css3.info/preview/box-shadow/