jQuery,qTip:工具提示字体大小始终相同

4

我正在使用qTip jQuery插件来制作工具提示。

我无法更改工具提示的字体大小。这是代码...任何数字2..4..8都会产生相同的结果。

$('.option img[title]').qtip({  
    style: { name: 'light', border: {width: 0}, title: { 'font-size': 2 } },        
        position: {
            corner: {
                target: 'topMiddle',
                tooltip: 'bottomMiddle'
                }
        }             
    });

谢谢

3个回答

10

我用 CSS 解决了:

.qtip-content {
    font-size:12px;
}

行高:14像素; //(字体大小增加2像素也可以帮助文本看起来更好) - Andre Nel

0

你需要添加"px",并且你可以在你的工具提示中添加任何css属性,但必须用引号括起来。

所以尝试这个(对我有用)

'font-size' : '12px'

-2

尝试去掉关于字体大小的引号

style: { name: 'light', border: {width: 0}, title: { font-size: 2 } }

在文档中特别提到了像这样引用属性。 - jplindstrom

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接