html - 使工具提示位置固定

标签 html css tooltip

我已经能够为我的应用程序创建工具提示。工具提示内容将来自数据库并且是动态的。有时它会有两行文本,有时会有五行文本。无论内容是什么,我都在努力保持位置固定。我可以尝试解决这个问题吗?

这是一个fiddle展示我所面对的。

.tooltip:hover .dumClass {
    display: inline;
    color: #ffffff;
    border: 1px solid #DCA;
    background: #444;
    -moz-border-radius: 11px;
    -webkit-border-radius: 11px;
    border-radius: 11px;
}

enter code here

最佳答案

CSS

.tooltip{position:relative;}
.tooltip .dumClass {
    z-index: 10;
    display: none;
    padding: 14px 20px;
    bottom:20px;
    left:0;
    width: 240px;
    line-height: 16px;
    position: absolute;
}

DEMO

关于html - 使工具提示位置固定,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22292484/

相关文章:

twitter-bootstrap - 将自定义属性添加到使用 Angular 的 ng-options 生成的 <select> 选项

html - 单击图像并选择 radio 不起作用

javascript - 如何使用 Flask 动态显示模态窗口并发送数据

wpf - 如何始终在拇指上显示 slider 的当前位置

javascript - 如何在 bootstrap 3 中将所有 div 居中

html - 网格不适用于 Bootstrap

Jquery Tooltip 图片预览左上放置导致错误

javascript - 向这个 jquery 添加第二个函数?

html - 背景图片未覆盖整个页面

html - 如何使用 Polymer 的霓虹元素过渡页面滚动