【发布时间】:2014-02-04 12:03:57
【问题描述】:
我正在开发一个 wordpress 网站。
我有一个包含标题和条目的包装器。
我的身体高度设置为身高:100%; Wrapper 设置为 height: 100% 和 min-height: 100%。
我的页面高度会根据我的条目内容扩展,这在大多数页面上都能完美运行。
但在某些页面上,我包含了纯 CSS 选项卡,它们设置为 position:absolute 才能工作。 我用了这个例子:http://www.onextrapixel.com/2013/07/31/creating-content-tabs-with-pure-css/
在包含这些选项卡的页面上,我的内容不再展开,我不能使用 position:relative 作为选项卡...
有没有办法根据我的标签接触高度来扩展身体高度? 也许使用 Js ? 谁能帮帮我?
这是我的 CSS:
html,body{
width: 100%;
max-width: 1220px;
font-family: 'andale';
font-size:14px;
line-height: 20px;
color: black;
text-transform: none;
background-color: #4C4C4C;
letter-spacing: 2px;height: 97%;}
#wrapper{
background-color: white;
height: auto !important; /* ie6 ignores !important, so this will be overridden below */ min-height: 100%; /* ie6 ignores min-height completely */
margin-left: 20px;
margin-top: 20px;
padding-top: 20px;
height: 100%;}
.entry{
padding-left: 20px;
padding-right: 20px;}
#header{
font-size: 14px;
line-height: 20px;
width: 100%;
color: #FF5000;
text-decoration: none}
.menu-menu-container{clear: both;padding-top: 5px;}
#menu-menu {list-style:none;}
.menu-item {float:left;}
#menu-menu li:after{content:"\00a0|";}
#menu-menu li:before{content:"\00a0";}
#menu-menu li:first-child:before{content:"";}
#menu-menu li:last-child:after{content:"";}
#menu-menu li.current_page_item a { color:#FF5000;text-decoration: line-through }
#menu-menu li.current-page-ancestor a { color:#FF5000;text-decoration: line-through }
.tabs input[type=radio] {
position: absolute;
top: -9999px;
left: -9999px;
}
.tabs {
list-style: none;
position: relative;}
.tabs li{
float: left;}
.tabs li:after{
content:"|\00a0";}
.tabs li:last-child:after{
content:"";}
.tabs label:hover {
color:#FF5000;
text-decoration: line-through}
[id^=tab]:checked + label {
color:#FF5000;
text-decoration: line-through}
[id^=tab]:checked ~ [id^=tab-content] {display: block;}
.tab-content{
z-index: 2;
display: none;
text-align: left;
width: 100%;
left: 0;
position: absolute;}
这是一个 jsfiddle http://jsfiddle.net/MPhnP/
任何人都可以帮助我吗?是否可以使用我正在使用的 CSS 选项卡? 非常感谢您的帮助!
【问题讨论】:
标签: html css wordpress tabs height