gpt4 book ai didi

html - 选项卡模型第 4 个 child 未显示

转载 作者:太空宇宙 更新时间:2023-11-04 08:12:26 25 4
gpt4 key购买 nike

我正在研究这个选项卡模型,但遇到了一些问题。我刚刚浏览了选项卡模型,发现这很有趣。但我发现只有三个标签。因此,据我所知,我已经为第四个选项卡添加了代码,但它没有显示。旋转有一些错误计算。

.perspective {
perspective: 76em;
perspective-origin: 50% 50px;
width: 494px;
margin: 0 auto;
font-family: 'Roboto', sans-serif;
font-weight: 100;
color: #fff;
text-align: center;
}

input {
display: none;
}

.tab {
position: absolute;
width: 60px;
height: 47px;
background: pink;
right: 10px;
line-height: 47px;
font-weight: 300;
}

.tab:nth-child(1) {
top: -5px;
background: #06d6a0;
}

.tab:nth-child(2) {
top: 53px;
background: #1b9aaa;
}

.tab:nth-child(3) {
top: 112px;
background: #ef476f;
}

.tab:nth-child(4) {
top: 170px;
background: GREEN;
}

.cube {
position: relative;
margin: 60px auto 0;
width: 300px;
height: 200px;
transform-origin: 0 100px;
transform-style: preserve-3d;
transition: transform 0.5s ease-in;
}

.tab-content {
width: 300px;
height: 200px;
position: absolute;
}

.tab-content h1 {
font-size: 25px;
margin: 75px 0 10px;
font-weight: 300;
}

.tab-content p {
font-size: 12px;
}

.tab-content:nth-child(1) {
transform: rotateX(-270deg) translateY(-100px);
transform-origin: top left;
background: #06d6a0;
}

.tab-content:nth-child(2) {
transform: translateZ(100px);
background: #1b9aaa;
}

.tab-content:nth-child(3) {
transform: rotateX(-90deg) translateY(100px);
transform-origin: bottom center;
background: #ef476f;
}

.tab-content:nth-child(4) {
transform: rotateX(25deg) translateY(-20px);
transform-origin: bottom center;
background: #9f476f;
}

#tab-top:checked~.cube {
transform: rotateX(-90deg);
}

#tab-front:checked~.cube {
transform: rotateX(0deg);
}

#tab-bottom:checked~.cube {
transform: rotateX(90deg);
}

#tab-back:checked~.cube {
transform: rotateX(45deg);
}
<h4>Standard Accordion with A little styling</h4>

<div class="perspective">

<label class="tab" for="tab-top">TOP</label>
<label class="tab" for="tab-front">FRONT</label>
<label class="tab" for="tab-bottom">BOTTOM</label>
<label class="tab" for="tab-bottom">BACK</label>
<input type="radio" name="tabs" id="tab-top">
<input type="radio" name="tabs" id="tab-front">
<input type="radio" name="tabs" id="tab-bottom">
<input type="radio" name="tabs" id="tab-back">

<div class="cube">
<div class="tab-content">
<h1>TOP CONTENT</h1>
<p>THIS IS AWESOME</p>
</div>
<div class="tab-content">
<h1>FRONT CONTENT</h1>
<p>THIS IS COOL</p>
</div>
<div class="tab-content">
<h1>BOTTOM CONTENT</h1>
<p>THIS IS SWEET</p>
</div>
<div class="tab-content">
<h1>BACK CONTENT</h1>
<p>THIS IS SPECTACULAR</p>
</div>
</div>
</div>

最佳答案

您错过了更改最后一项的类别。

现在:

<label class="tab" for="tab-bottom">BACK</label>

应该是:

<label class="tab" for="tab-back">BACK</label>

关于html - 选项卡模型第 4 个 child 未显示,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46176042/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com