搜索输入占位符的字体替换

时间:2012-09-19 04:13:36

标签: cufon font-replacement

All-One-Cufon目前,将更改为其他ttf字体替换..

当使用All-One-Cufon插件时,我发现cufon代码不能用通常用于改变颜色的相同html5代码替换占位符:

#rightHalf input::-webkit-input-placeholder {
    color: #f9a11b;
}
#rightHalf input:-moz-placeholder {
    color: #f9a11b;
}
#rightHalf input:-ms-input-placeholder {
    color: #f9a11b;
}

Cufon代码:

Cufon.replace('#rightHalf input::-webkit-input-placeholder');
Cufon.replace('#rightHalf input:-moz-placeholder');
Cufon.replace('#rightHalf input:-ms-input-placeholder');

这不起作用。也没有试图瞄准输入:

HTML:

<input type="text" class="field" name="s" id="s" placeholder="Search for Products, Services & Supplier ">

Cufon代码:

Cufon.replace('#s');

导致:

    <input type="text" class="field" name="s" id="s" placeholder="Search for Products, Services &amp; Supplier ">    
<cufon class="cufon cufon-canvas" alt=" " style="width: 3px; height: 12px; ">
<canvas width="15" height="14" style="width: 15px; height: 14px; top: -1px; left: -2px; "></canvas><cufontext></cufontext></cufon>
<input type="submit" class="submit" name="submit" id="searchsubmit" value="Search"></form>

失败并扰乱间距...

CSS(cufon JS上的fontFamily设置为“arialnarrow”):

font-family: 'arialnarrow';

font: arialnarrow;

font-family: 'arialnarrow' !important;

font: arialnarrow !important;

没有做任何事......正如我所预料的那样,当cufon添加html来改变文本外观并且占位符在输入内时,可以通过css而非html来定位..

  • 有谁知道我怎么能这样做? 来自ttf字体的占位符的字体替换

  • Arial Narrow Gonzit.com &lt; - 顶级搜索栏占位符文字需要更换..

  • 感谢任何帮助,需要尽快关闭!!

泰德

0 个答案:

没有答案