【问题标题】:CSS3: Glowing background on link-hover (not text-glow)CSS3:链接悬停上的发光背景(不是文本发光)
【发布时间】:2013-01-21 15:17:31
【问题描述】:

我有一个菜单,包含几个链接。我希望这些链接在悬停时在背景中具有发光效果。

我几乎已经在链接上使用了 css 过渡、框阴影和较浅的背景色。

问题是过渡效果会影响 box-shadow,所以当过渡开始时,链接没有 box-shadow,这给了它们一个平方的背景颜色。过渡结束后,发光的背景看起来很好。

请看我的 jsFiddle:http://jsfiddle.net/xCJ46/

非常感谢您的帮助。

这是我的 CSS 的摘录:

<html><style>
div a:hover {
    background: #527fa9;

    -webkit-box-shadow: inset 0 0 30px 15px #49628a;
    -moz-box-shadow: inset 0 0 30px 15px #49628a;
    box-shadow: inset 0 0 30px 15px #49628a;

    -webkit-transition: 500ms linear 0s;
    -moz-transition: 500ms linear 0s;
    -o-transition: 500ms linear 0s;
    transition: 500ms linear 0s;
}
</style></html>

【问题讨论】:

  • 将 box-shadow 添加到链接的属性(不是悬停)。 F.e. div a { box-shadow: inset 0 0 30px 15px #49628a; }

标签: css-transitions css glow


【解决方案1】:

将 box-shadow 添加到链接的属性(不是悬停)。

div a { box-shadow: inset 0 0 30px 15px #49628a; }

【讨论】:

猜你喜欢
  • 2015-11-03
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2013-01-13
  • 1970-01-01
  • 2012-04-11
  • 1970-01-01
相关资源
最近更新 更多