Html 如何使儿童div在tympanus.net中可见';s CSS无线电检查选项卡方法

Html 如何使儿童div在tympanus.net中可见';s CSS无线电检查选项卡方法,html,css,tabs,Html,Css,Tabs,我使用以下方法制作css选项卡: 我希望在选项卡的内容中使用div(例如,如果我在.tabContent1中放置一个div),但是它们的可见性似乎为0,并且它们的位置是绝对的。我怎样才能解决这个问题 HTML: 更改: .tabContent div{ 致: .tabContent>div{ 目前,您正在将.tabContent中的所有div元素设置为position:absolute等,您只想对直接子女执行此操作(使用选择器)为了不影响选项卡内容中使用的div元素。谢谢!!!我真的很紧张,但

我使用以下方法制作css选项卡:

我希望在选项卡的内容中使用div(例如,如果我在.tabContent1中放置一个div),但是它们的可见性似乎为0,并且它们的位置是绝对的。我怎样才能解决这个问题

HTML:

更改:

.tabContent div{

致:

.tabContent>div{


目前,您正在将
.tabContent
中的所有
div
元素设置为
position:absolute
等,您只想对直接子女执行此操作(使用
选择器)为了不影响选项卡内容中使用的
div
元素。

谢谢!!!我真的很紧张,但看不到问题所在。非常感谢!最后一个问题,我该怎么做。选项卡内容的高度会扩大,这样子项就不会溢出
            <div class="content">               
                <div class="productTabs">
<!-- Tabs Label / Buttons -->
                    <input id="productTab1" type="radio" name="radio-set" class="productTabRadio1" checked="checked" />
                    <label for="productTab1" class="productTabLabel1"></label>

                    <input id="productTab2" type="radio" name="radio-set" class="productTabRadio2" />
                    <label for="productTab2" class="productTabLabel2"></label>

                    <input id="productTab3" type="radio" name="radio-set" class="productTabRadio3" />
                    <label for="productTab3" class="productTabLabel3"></label>

                    <input id="productTab4" type="radio" name="radio-set" class="productTabRadio4" />
                    <label for="productTab4" class="productTabLabel4"></label>

                    <input id="productTab5" type="radio" name="radio-set" class="productTabRadio5" />
                    <label for="productTab5" class="productTabLabel5"></label>

                    <input id="productTab6" type="radio" name="radio-set" class="productTabRadio6" />
                    <label for="productTab6" class="productTabLabel6"></label>

                    <div class="clear">&nbsp;</div>
<!-- Tabs Content -->
                    <div class="tabContent">
                        <div class="tabContent1">
                            <h2>Our Products and Apps</h2>
                        </div>
                        <div class="tabContent2">
                            <h2>Sage Products</h2>
                        </div>
                        <div class="tabContent3">
                            <h2>Microsoft Products</h2>
                        </div>
                        <div class="tabContent4">
                            <h2>3rd Party Sage Addons</h2>
                        </div>
                        <div class="tabContent5">
                            <h2>Support Packages</h2>
                        </div>
                        <div class="tabContent6">
                            <h2>Cloud Products</h2>
                        </div>
                    </div>
                </div>
            </div>
 .clear {
    clear: both;
}
.tabs {
    width: 750px;
}
.productTabs input {
    position: absolute;
    width: 120px;
    height: 40px;
    z-index: 1000;
    opacity: 0;
    -ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";
    filter: alpha(opacity=0);
}
.productTabs label {
    position: relative;
    left: 40px;
    float: left;
    width: 132px;
    height: 150px;
    display: block;
    margin: 0 5px 0 0;
    color: black;
}
.productTabLabel1 {
    z-index: 6;
    background-image: url('http://wbrodie.com/jsfiddle/img/tab1.jpg');
}
.productTabLabel1:hover {
    z-index: 6;
    background-image: url('http://wbrodie.com/jsfiddle/img/tab1selected.jpg');
}
.productTabLabel2 {
    z-index: 5;
    background-image: url('http://wbrodie.com/jsfiddle/img/tab2.jpg');
}
.productTabLabel2:hover {
    z-index: 5;
    background-image: url('http://wbrodie.com/jsfiddle/img/tab2selected.jpg');
}
.productTabLabel3 {
    z-index: 4;
    background-image: url('http://wbrodie.com/jsfiddle/img/tab3.jpg');
}
.productTabLabel3:hover {
    z-index: 4;
    background-image: url('http://wbrodie.com/jsfiddle/img/tab3selected.jpg');
}
.productTabLabel4 {
    z-index: 3;
    background-image: url('http://wbrodie.com/jsfiddle/img/tab4.jpg');
}
.productTabLabel4:hover{
    z-index: 3;
    background-image: url('http://wbrodie.com/jsfiddle/img/tab4selected.jpg');
}
.productTabLabel5 {
    z-index: 2;
    background-image: url('http://wbrodie.com/jsfiddle/img/tab5.jpg');
}
.productTabLabel5:hover {
    z-index: 2;
    background-image: url('http://wbrodie.com/jsfiddle/img/tab5selected.jpg');
}
.productTabLabel6 {
    z-index: 1;
    background-image: url('http://wbrodie.com/jsfiddle/img/tab6.jpg');
}
.productTabLabel6:hover {
    z-index: 1;
    background-image: url('http://wbrodie.com/jsfiddle/img/tab6selected.jpg');
}
 .clear {
    clear: both;
}
.tabContent {
    background: #ddd;
    position: relative;
    width: 900px;
    min-height: 100px;
    z-index: 10;
}
.tabContent div {
    position: absolute;
    top: 0;
    left: 0;   //makes all tabs content appear in same place

    z-index: 1;
    opacity: 0;  //Makes content invisivble when not selected

    -webkit-transition: opacity linear 0.1s;
    -moz-transition: opacity linear 0.1s;
    -o-transition: opacity linear 0.1s;
    -ms-transition: opacity linear 0.1s;
    transition: opacity linear 0.1s;
}
.productTabs input.productTabRadio1:checked ~ .tabContent .tabContent1,
.productTabs input.productTabRadio2:checked ~ .tabContent .tabContent2,
.productTabs input.productTabRadio3:checked ~ .tabContent .tabContent3,
.productTabs input.productTabRadio4:checked ~ .tabContent .tabContent4,
.productTabs input.productTabRadio5:checked ~ .tabContent .tabContent5,
.productTabs input.productTabRadio6:checked ~ .tabContent .tabContent6{
    z-index: 100;
    -ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=100)";
    filter: alpha(opacity=100);
    opacity: 1;

    -webkit-transition: opacity ease-out 0.2s 0.1s;
    -moz-transition: opacity ease-out 0.2s 0.1s;
    -o-transition: opacity ease-out 0.2s 0.1s;
    -ms-transition: opacity ease-out 0.2s 0.1s;
    transition: opacity ease-out 0.2s 0.1s;
}