Prevent CSS tooltip from going out of page/window

后端 未结 5 2130
时光说笑
时光说笑 2021-02-01 04:39

I have a CSS only tooltip which loads a span as a tooltip when you hover the link. However this is positioned with CSS but if the link is near to the t

5条回答
  •  没有蜡笔的小新
    2021-02-01 04:47

    just copy this css nd replace with your class

    .ref .ktooltiptext, .refs .ktooltiptext

    .ref .ktooltiptext, .refs .ktooltiptext {
      visibility:hidden;
      width: 200px;
      background: #fff;
      border-radius: 6px;
      padding: 5px 5px;
      top: -15px;
      left: 10px;
      border:2px solid grey;
      line-height: normal;
    
        /* Position the tooltip */
        position: absolute;
        z-index: 1;
    }
    

提交回复
热议问题