我目前正在苦苦挣扎,因为这个问题的标题提到:根据选项卡内容的宽度将菜单选项卡居中。另外我不确定为什么内容和菜单选项卡之间存在差距。
问题:为什么菜单不适应标签内容的宽度?
CSS jquery ui-tabs.css
<style>
#page-wrap { width: 675px; margin: auto; background:#FFF;}
.ui-tabs { zoom: 1; }
.ui-tabs .ui-tabs-nav { list-style: none; position: relative; overflow: hidden;
z-index: 1000; }
.ui-tabs .ui-tabs-nav li { position: relative; float: left;
border-bottom-width: 0 !important; background: #EBEBEB; }
.ui-tabs .ui-tabs-nav li a { float: left; text-decoration: none; padding: 5px 10px ; outline: medium none; font-weight: bold; font-size:11px; line-height:
35px;}
.ui-tabs .ui-tabs-nav
li.ui-tabs-selected { border-bottom-width: 0; background: #F9AE5C; color: #6A6A6A; border-top:1px solid #D4D4D4; border-left:1px solid #D4D4D4; border-right:1px solid #D4D4D4; }
.ui-tabs .ui-tabs-nav
li.ui-tabs-selected a, .ui-tabs
.ui-tabs-nav li.ui-state-disabled a,
.ui-tabs .ui-tabs-nav
li.ui-state-processing a { cursor: text; }
.ui-tabs .ui-tabs-nav li a,
.ui-tabs.ui-tabs-collapsible
.ui-tabs-nav li.ui-tabs-selected a { cursor: pointer; } /* first selector in group seems obsolete, but required to overcome bug in Opera applying cursor: text overall if defined elsewhere... */
.ui-tabs .ui-tabs-panel { padding: 20px; display: block; border-width: 0; background: none;
position: relative; min-height: 100px; border: 1px solid #D4D4D4; }
.ui-tabs .ui-tabs-hide { display: none !important; }
.pngIcon{ padding:0px 5px 0px 5px; vertical-align:top;}
a.mover { background: #900; padding: 6px 12px; position: absolute;
color: white; font-weight: bold; text-decoration: none;}
.next-tab { bottom: 0; right: 0; -moz-border-radius-topleft: 10px; -webkit-border-top-left-radius: 10px; }
.prev-tab { bottom: 0; left: 0; -moz-border-radius-topright: 10px; -webkit-border-top-right-radius: 10px; }
</style>