如何在FF中使css工具提示不推动元素轮廓

时间:2011-10-10 15:03:11

标签: css firefox tooltip

我正在关注发布here的示例来制作自定义css工具提示。

a {
  color: #900;
  text-decoration: none;
}

a:hover {
  color: red;
  position: relative;
}

a[title]:hover:after {
  content: attr(title);
  padding: 4px 8px;
  color: #333;
  position: absolute;
  left: 0;
  top: 100%;
  white-space: nowrap;
  z-index: 99;
  -moz-border-radius: 5px;
  -webkit-border-radius: 5px;
  border-radius: 5px;
  -moz-box-shadow: 0px 0px 4px #222;
  -webkit-box-shadow: 0px 0px 4px #222;
  box-shadow: 0px 0px 4px #222;
  background-image: -moz-linear-gradient(top, #eeeeee, #cccccc);
  background-image: -webkit-gradient(linear,left top,left bottom,color-stop(0, #eeeeee),color-stop(1, #cccccc));
  background-image: -webkit-linear-gradient(top, #eeeeee, #cccccc);
  background-image: -moz-linear-gradient(top, #eeeeee, #cccccc);
  background-image: -ms-linear-gradient(top, #eeeeee, #cccccc);
  background-image: -o-linear-gradient(top, #eeeeee, #cccccc);
}

我想知道是否有办法在FireFox中没有工具提示推出它的父元素outline,它似乎在Chrome中工作正常

div {
    display: inline-block;
    padding: 20px;
    border: 2px solid #000;
    outline: 2px solid #F00;
}

see example here

1 个答案:

答案 0 :(得分:2)

我看不出你怎么可能解决这个问题。我想知道这是不是Firefox的错误?

唯一想到的是使用box-shadow代替outline

http://jsfiddle.net/thirtydot/HgeVh/9/

如果这很重要,那么你就会失去IE8中的大纲。