Autoresize css工具提示

我有这个css tootlip代码:


    a.tooltips {
      position: relative;
      display: inline;
    }
    a.tooltips span {
      position: absolute;
      width:140px;
      color: #FFFFFF;
      background: #000000;
      height: 30px;
      line-height: 30px;
      text-align: center;
      visibility: hidden;
      border-radius: 6px;
    }
    a.tooltips span:after {
      content: '';
      position: absolute;
      top: 100%;
      left: 50%;
      margin-left: -8px;
      width: 0; height: 0;
      border-top: 8px solid #000000;
      border-right: 8px solid transparent;
      border-left: 8px solid transparent;
    }
    a:hover.tooltips span {
      visibility: visible;
      opacity: 0.8;
      bottom: 30px;
      left: 50%;
      margin-left: -76px;
      z-index: 999;
    }

我希望它根据文本长度自动调整大小。 (长或短)..我怎么能做到这一点? 谢谢。


摆脱; width:140px; 从类a.tooltips span

链接地址: http://www.djcxy.com/p/89175.html

上一篇: Autoresize css tooltip

下一篇: I can't get this picture in the background of my div