Firefox userChrome.css工具提示不需要的白色边框

时间:2014-04-12 02:56:48

标签: css css3 firefox

在我的userChrome.css中:

@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); /* set default namespace to XUL */

tooltip {
  padding: 0px !important;
  padding-left: 0px !important;
  background-color: #000000 !important;
  border-width: 0px !important;
  border-left-width: 0px !important;
  border-right-width: 0px !important;
  border-top-width: 0px !important;
  border-bottom-width: 0px !important;
}
tooltip * {
  color: red !important;
  background-color: #000000 !important;
}

工具提示有不需要的白色边框:

Tooltip Image

CSS border-width: 0px;试图摆脱这种情况。如果我尝试使用任何类型的CSS margin:,工具提示会以不希望的方式轻弹然后关闭。

2 个答案:

答案 0 :(得分:0)

好的,这是我自己的问题的答案,代码:

tooltip css

将生产:

Nice tooltip

注意:box-shadow似乎不适用于工具提示,但opacityborder-radius会这样做。

tooltip {
  padding: 6px !important;
  background-color: #000000 !important;
  border-width: 0px !important;
  border-left-width: 0px !important;
  border-right-width: 0px !important;
  border-top-width: 0px !important;
  border-bottom-width: 0px !important;
  border: 1px solid blue !important;
  border-radius:6px;
  opacity: 0.8;
}
tooltip * {
  color: #cccccc !important;
  background-color: #000000 !important;
  margin:0px !important;
  margin-left: 0px !important;
  margin-right: 0px !important;
  margin-top: 0px !important;
  margin-bottom: 0px !important;
  padding:0px !important;
  padding-left: 0px !important;
  padding-right: 0px !important;
  padding-top: 0px !important;
  padding-bottom: 0px !important;
  border-width: 0px !important;
  border-left-width: 0px !important;
  border-right-width: 0px !important;
  border-top-width: 0px !important;
  border-bottom-width: 0px !important;
}

答案 1 :(得分:0)

可能缺少-moz-appearance: none !important。以下是FreeBSD上Firefox 45.0中对我有用的内容:

/* Tooltips. */
tooltip {
    -moz-appearance: none !important;
    padding: 0px !important;
    border: solid #dd99bb !important;
    border-radius: 3px !important;
}

tooltip * {
    background-color: #620044 !important;
    color: white !important;
    padding: 2px 5px 3px 5px !important;
    font-size: 7pt !important;
}