简体   繁体   English

如何更改 jQuery-UI 选项卡的字体大小和选项卡宽度和高度

[英]How to change font size and tab width & height of jQuery-UI tabs

I am using jQuery-UI to add tabs on my page, after I added it, I feel the tab font size and tab width and height are too large for my page.我正在使用 jQuery-UI 在我的页面上添加标签,添加后,我觉得标签字体大小和标签宽度和高度对于我的页面来说太大了。 I would like to change the font size and tab width and height.我想更改字体大小和标签宽度和高度。 How to do it?怎么做?

您需要在这样的 css 类中更改它

.ui-tabs .ui-tabs-nav li a {font-size:7pt !important;}

Go to the jQuery UI ThemeRoller and create your own theme or modify the presets.转到jQuery UI ThemeRoller并创建您自己的主题或修改预设。 On the right hand side under 'Font settings' there is the option to change the font size.在右侧的“字体设置”下,可以选择更改字体大小。

ThemeRoller 字体设置

As for the size of the tabs, look at the CSS file that came with the jQuery UI package you downloaded.至于选项卡的大小,请查看您下载的 jQuery UI 包附带的 CSS 文件。 Find the selector for the jQuery UI tabs and edit the padding property:找到 jQuery UI 选项卡的选择器并编辑 padding 属性:

.ui-tabs .ui-tabs-nav li a { float: left; padding: .5em 1em; text-decoration: none; }

In Firefox 84.0 (Jan 2021) this worked:在 Firefox 84.0(2021 年 1 月)中,这有效:

.ui-tabs .ui-tabs-nav li a {
  color: blue !important;
}

.ui-tabs .ui-tabs-nav li a {
  font-size: 12px !important;
  font-weight: bold !important;
  color: blue !important;
  // etc.
}

Note that I needed both of those specifications;请注意,我需要这两个规范; ie: set color in both li a {} and a {} .即:在li a {}a {}设置color

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM