在 JQuery UI 中将一个选项卡右对齐
我有一组选项卡,代表表单的不同部分,全部靠左对齐。当用户填写完所有部分后,我希望他能够查看整个表单。
我使用 jQuery UI 选项卡将各个部分分成不同的部分。用户可以根据需要在各个部分之间切换。
我现在想要以下内容:
- 部分选项卡标题应向左对齐(这是 jQuery UI 的默认设置)
- 打印概述选项卡标题应向右对齐并且(可能)具有不同的样式
所以问题是:如何才能我要更改 jQuery UI 中单个选项卡的样式吗?
I have a set of tabs, representing different sections of a form, all aligned to the left. When a user has filled in all sections, I want him to be able to review the entire form.
I'm using jQuery UI Tabs to split the sections in different parts. The user can switch between the sections as often as he wants.
I now want the following:
- The section tab headers should be aligned to the left (this is default for jQuery UI)
- The printing overview tab header should be aligned to the right and (possibly) have a different style
So the question is: how can I change the style of an individual tab in jQuery UI?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您应该能够在想要右对齐的选项卡上设置
id
或class
属性,然后您可以为该 id 或 class 设置 css,您可能需要使用!important
在您的自定义样式之后,以便 jqueryui 样式表将被您的设置覆盖http: //jsfiddle.net/4Xmkf/1/
这是一个 jsfiddle,显示了一个简单的示例
you should be able to set an
id
orclass
attribute on the tab you want right aligned, you can then set the css for that id or class, you may need to use!important
after your custom styling so that the jqueryui stylesheet will be overridden with your settingshttp://jsfiddle.net/4Xmkf/1/
here's a jsfiddle showing a simple example
我认为你可以用 CSS 来做到这一点。如果您从
构建选项卡,则只需将一个类添加到最后一个
(概述类),然后使用 CSS 使其浮动向右。
您也应该能够使用该类来执行您想要的任何其他样式。
希望这有帮助!
I think you could do this with CSS. If you build your tabs from a
<ul>
, then just add a class to the last<li>
(the overview one), and use CSS to float it to the right.You should be able to use that class to do whatever other styling you want, too.
Hope this helps!