2012-07-27 28 views
2

如何更改jQuery UI的组合框里面的字体和下拉列表 我的代码是:变化jQuery UI的组合框字体

.ui-autocomplete-input { 
       margin: 0; 
       padding: 0.3em; 
       font-family:"Times New Roman", Times, serif; 
      } 
      .ui-autocomplete 
      { 
       font-family:"Times New Roman", Times, serif; 
       max-height: 200px; 
       overflow-y: auto; 
       /* prevent horizontal scrollbar */ 
       overflow-x: hidden; 
       /* add padding to account for vertical scrollbar */ 
       z-index:1000; 
      } 

但没有什么变化,我不知道哪里是错误

回答

2

试试这个:

.ui-menu .ui-menu-item { 
    font-family:"Times New Roman", Times, serif; 
} 
+0

它的工作,但同样的错误是线程http://stackoverflow.com/questions/11689144/arabic-characters-are-displayed-separately-in-google-chrome 如果你能帮助我,你知道很多jQuery的用户界面将被格子 – 2012-07-27 15:40:34

+0

尝试:.ui-widget {font-family:“Times New Roman”,Times,serif;} – SomeoneS 2012-07-27 15:44:21

+0

不幸的是它没有工作:S谢谢你的帮助和你的尝试:D – 2012-07-28 11:55:26

1

它会被其他一些CSS覆盖。您可以使用this来主题化您的jQuery UI。

1

如果你想改变你的jQuery UI的样子,你应该使用由开发商提供的工具 - themeroller。即使您找到了设置字体的方法,但您可能没有完全意识到主题设置及其评估方式,这意味着有时候您可能会得到正确的行为,而其他时候则不会。

话虽这么说,如果你添加!important到CSS设置它的结束会覆盖其他样式:

font-family:"Times New Roman", Times, serif !important; 

但你可能不应该这样做。