Hallo
ich hab ein problem, wenn ich in einem blog/post Tabs erstellen möchste und der "Titel" des Tabs zulange ist wird der "Button" nicht verlängert!
Hier ein Bild um es verständlicher zu machen! :D
Laut css haben die Tabs ne feste breite 95px. wenn ich aber 100% wird ein Tab in der vollen contentbreite angezeigt.
das hier steht in der css:
PHP
/* Tabs */
.tabs-nav{
height: 39px;
margin-bottom: 0;
padding: 0 !important;
list-style: none;
margin-left: 0;
text-shadow: none;
display: block;
}
.tabs-wrapper ul.tabs-nav li {
float: left;
height: 36px;
list-style-type: none;
margin-right: 3px;
position: relative;
text-align: center;
padding: 0;
width: 95px;
overflow: hidden;
-moz-border-radius: 5px 5px 0 0;
-webkit-border-radius: 5px 5px 0 0;
-khtml-border-radius: 5px 5px 0 0;
border-radius: 5px 5px 0 0;
}
.tabs-wrapper ul.tabs-nav li a {
border-bottom: medium none;
text-transform: uppercase;
height: 100%;
left: 0;
line-height: 36px;
position: absolute;
text-decoration: none;
top: 0;
width: 100%;
-moz-border-radius: 5px 5px 0 0;
-webkit-border-radius: 5px 5px 0 0;
-khtml-border-radius: 5px 5px 0 0;
border-radius: 5px 5px 0 0;
}
.tabs-wrapper ul.tabs li a {
text-transform: none;
}
.tabs-wrapper .pane {
clear: both;
}
Alles anzeigen
und das hier in einer php namens funktions.php
PHP
// Tabs
add_shortcode('tabs', 'gamepress_shortcode_tabs');
function gamepress_shortcode_tabs( $atts, $content = null ) {
extract(shortcode_atts(array(
), $atts));
$out = '';
$out .= '[raw]<div class="tabs-wrapper">[/raw]';
$out .= '<ul class="tabs tabs-nav">';
foreach ($atts as $tab) {
$out .= '<li><a href="#">' .$tab. '</a></li>';
}
$out .= '</ul>';
$out .= do_shortcode($content) .'[raw]</div>[/raw]';
return $out;
}
add_shortcode('tab', 'gamepress_shortcode_tab');
function gamepress_shortcode_tab( $atts, $content = null ) {
extract(shortcode_atts(array(
), $atts));
$out = '';
$out .= '[raw]<div class="pane">[/raw]' . do_shortcode($content) .'</div>';
return $out;
}
Alles anzeigen
Ich will das die Tabs sich an dem Text anpassen. Kann mir da bitte jemand helfen?