简体   繁体   English

选项卡使中心对齐

[英]Tabs to make center aligned

This is the WordPress theme tab I am working on and I am trying to make he tabs center aligned. 是我正在处理的WordPress主题标签,我正在尝试使标签居中对齐。 I tried to make various changes in the firebug but the alignment doesn't set to center accurately cause when I change the width the alignment gets unaligned. 我尝试在firebug中进行各种更改,但是对齐没有设置为准确居中,因为当我更改宽度时,对齐变得不对齐。 Kindly let me know how can I make the tabs center aligned like following image which should work regardless whatever the width is: 请告诉我如何使标签中心对齐,如下图所示,无论宽度如何,都应该有效:

/*Tab*/
.shortcode-tab-wrap .tabs {
    list-style: none;
    margin: 0;
}

.shortcode-tab .tabs li.tab {
    float: left;
    position: relative;
}

.shortcode-tab .tabs li.tab a {
    display: block;
    height: 45px;
    line-height: 45px;
    padding: 0 20px;
}

.shortcode-tab .tabs li.tab a .separate {
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 1px;
    display: block;
}

.shortcode-tab .tabs-content {
    padding: 20px;
}

.shortcode-left-tab {
    position: relative;
}

.shortcode-left-tab .tabs {
    position: absolute;
    top: 0;
    left: 2px;
    width: 200px;
}

.shortcode-left-tab .tabs li.tab {
    position: relative;
}

.shortcode-left-tab .tabs li.tab a {
    display: block;
    height: 45px;
    line-height: 45px;
    padding: 0 20px;
}

.shortcode-left-tab .tabs li.tab a .separate {
    position: absolute;
    top: 0;
    right: -1px;
    width: 1px;
    height: 45px;
    display: block;
}

.shortcode-left-tab .tabs-content {
    margin-left: 202px;
    padding: 20px;
}
.shortcode-tab {
    text-align: center; /* Center tabs */
}

.shortcode-tab .tabs {
    display: inline-block;
    vertical-align: bottom;
}

.shortcode-tab .tabs-content {
    text-align: left; /* Reset content text */
}

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

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