- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我在同一个 HTML 页面中有三个幻灯片,前两个工作正常但第三个不行,它的图像不能正确滑动。
body {
background-color: #000000;
}
.carousel > input[type="radio"]:nth-child(1):checked ~ .carousel__prev > label:nth-child(4),
.carousel > input[type="radio"]:nth-child(1):checked ~ .carousel__next > label:nth-child(2),
.carousel > input[type="radio"]:nth-child(2):checked ~ .carousel__prev > label:nth-child(1),
.carousel > input[type="radio"]:nth-child(2):checked ~ .carousel__next > label:nth-child(3),
.carousel > input[type="radio"]:nth-child(3):checked ~ .carousel__prev > label:nth-child(2),
.carousel > input[type="radio"]:nth-child(3):checked ~ .carousel__next > label:nth-child(4),
.carousel > input[type="radio"]:nth-child(4):checked ~ .carousel__prev > label:nth-child(3),
.carousel > input[type="radio"]:nth-child(4):checked ~ .carousel__next > label:nth-child(1),
.carousel-2 > input[type="radio"]:nth-child(1):checked ~ .carousel__prev-2 > label:nth-child(4),
.carousel-2 > input[type="radio"]:nth-child(1):checked ~ .carousel__next-2 > label:nth-child(2),
.carousel-2 > input[type="radio"]:nth-child(2):checked ~ .carousel__prev-2 > label:nth-child(1),
.carousel-2 > input[type="radio"]:nth-child(2):checked ~ .carousel__next-2 > label:nth-child(3),
.carousel-2 > input[type="radio"]:nth-child(3):checked ~ .carousel__prev-2 > label:nth-child(2),
.carousel-2 > input[type="radio"]:nth-child(3):checked ~ .carousel__next-2 > label:nth-child(4),
.carousel-2 > input[type="radio"]:nth-child(4):checked ~ .carousel__prev-2 > label:nth-child(3),
.carousel-2 > input[type="radio"]:nth-child(4):checked ~ .carousel__next-2 > label:nth-child(1),
.carousel-3 > input[type="radio"]:nth-child(1):checked ~ .carousel__prev-3 > label:nth-child(4),
.carousel-3 > input[type="radio"]:nth-child(1):checked ~ .carousel__prev-3 > label:nth-child(2),
.carousel-3 > input[type="radio"]:nth-child(2):checked ~ .carousel__prev-3 > label:nth-child(1),
.carousel-3 > input[type="radio"]:nth-child(2):checked ~ .carousel__prev-3 > label:nth-child(3),
.carousel-3 > input[type="radio"]:nth-child(3):checked ~ .carousel__prev-3 > label:nth-child(2),
.carousel-3 > input[type="radio"]:nth-child(3):checked ~ .carousel__prev-3 > label:nth-child(4),
.carousel-3 > input[type="radio"]:nth-child(4):checked ~ .carousel__prev-3 > label:nth-child(3),
.carousel-3 > input[type="radio"]:nth-child(4):checked ~ .carousel__prev-3 > label:nth-child(1) {
opacity: 1 !important;
z-index: 3;
}
*, *:before, *:after {
box-sizing: border-box;
}
.container,
.container-2,
.container-3 {
width: 100%;
margin: 0 0 10px 0;
}
.carousel,
.carousel-2,
.carousel-3 {
width: 100%;
height: 300px;
position: relative;
overflow: hidden;
}
.carousel > input[type="radio"],
.carousel-2 > input[type="radio"],
.carousel-3 > input[type="radio"] {
position: absolute;
left: 0;
opacity: 0;
top: 0;
}
.carousel > input[type="radio"]:checked ~ .carousel__items .carousel__item,
.carousel > input[type="radio"]:checked ~ .carousel__prev > label,
.carousel > input[type="radio"]:checked ~ .carousel__next > label,
.carousel-2 > input[type="radio"]:checked ~ .carousel__items-2 .carousel__item-2,
.carousel-2 > input[type="radio"]:checked ~ .carousel__prev-2 > label,
.carousel-2 > input[type="radio"]:checked ~ .carousel__next-2 > label,
.carousel-3 > input[type="radio"]:checked ~ .carousel__items-3 .carousel__item-3,
.carousel-3 > input[type="radio"]:checked ~ .carousel__prev-3 > label,
.carousel-3 > input[type="radio"]:checked ~ .carousel__next-3 > label {
opacity: 0;
}
.carousel > input[type="radio"]:nth-child(1):checked ~ .carousel__items .carousel__item:nth-child(1),
.carousel-2 > input[type="radio"]:nth-child(1):checked ~ .carousel__items-2 .carousel__item-2:nth-child(1),
.carousel-3 > input[type="radio"]:nth-child(1):checked ~ .carousel__items-3 .carousel__item-3:nth-child(1) {
opacity: 1;
}
.carousel > input[type="radio"]:nth-child(1):checked ~ .carousel__nav > label:nth-child(1),
.carousel-2 > input[type="radio"]:nth-child(1):checked ~ .carousel__nav-2 > label:nth-child(1),
.carousel-3 > input[type="radio"]:nth-child(1):checked ~ .carousel__nav-3 > label:nth-child(1) {
background: #ccc;
cursor: default;
pointer-events: none;
}
.carousel > input[type="radio"]:nth-child(2):checked ~ .carousel__items .carousel__item:nth-child(2),
.carousel-2 > input[type="radio"]:nth-child(2):checked ~ .carousel__items-2 .carousel__item-2:nth-child(2),
.carousel-3 > input[type="radio"]:nth-child(2):checked ~ .carousel__items-3 .carousel__item-3:nth-child(2) {
opacity: 1;
}
.carousel > input[type="radio"]:nth-child(2):checked ~ .carousel__nav > label:nth-child(2),
.carousel-2 > input[type="radio"]:nth-child(2):checked ~ .carousel__nav-2 > label:nth-child(2),
.carousel-3 > input[type="radio"]:nth-child(2):checked ~ .carousel__nav-3 > label:nth-child(2) {
background: #ccc;
cursor: default;
pointer-events: none;
}
.carousel > input[type="radio"]:nth-child(3):checked ~ .carousel__items .carousel__item:nth-child(3),
.carousel-2 > input[type="radio"]:nth-child(3):checked ~ .carousel__items-2 .carousel__item-2:nth-child(3),
.carousel-3 > input[type="radio"]:nth-child(3):checked ~ .carousel__items-3 .carousel__item-3:nth-child(3) {
opacity: 1;
}
.carousel > input[type="radio"]:nth-child(3):checked ~ .carousel__nav > label:nth-child(3),
.carousel-2 > input[type="radio"]:nth-child(3):checked ~ .carousel__nav-2 > label:nth-child(3),
.carousel-3 > input[type="radio"]:nth-child(3):checked ~ .carousel__nav-3 > label:nth-child(3) {
background: #ccc;
cursor: default;
pointer-events: none;
}
.carousel > input[type="radio"]:nth-child(4):checked ~ .carousel__items .carousel__item:nth-child(4),
.carousel-2 > input[type="radio"]:nth-child(4):checked ~ .carousel__items-2 .carousel__item-2:nth-child(4),
.carousel-3 > input[type="radio"]:nth-child(4):checked ~ .carousel__items-3 .carousel__item-3:nth-child(4) {
opacity: 1;
}
.carousel > input[type="radio"]:nth-child(4):checked ~ .carousel__nav > label:nth-child(4),
.carousel-2 > input[type="radio"]:nth-child(4):checked ~ .carousel__nav-2 > label:nth-child(4),
.carousel-3 > input[type="radio"]:nth-child(4):checked ~ .carousel__nav-3 > label:nth-child(4) {
background: #ccc;
cursor: default;
pointer-events: none;
}
.carousel__items,
.carousel__items-2,
.carousel__items-3 {
margin: 0;
padding: 0;
list-style-type: none;
width: 100%;
height: 600px;
position: relative;
}
.carousel__item,
.carousel__item-2,
.carousel__item-3 {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 1;
transition: opacity 2s;
}
.carousel__item img,
.carousel__item-2 img,
.carousel__item-3 img {
width: 100%;
height: 300px;
vertical-align: middle;
}
.carousel__item .caption,
.carousel__item-2 .caption-2,
.carousel__item-3 .caption-3 {
position: absolute;
width: 100%;
top: 43.4%;
left: 0;
margin: 0;
padding: 5px 0 15px 0;
background-color: rgba(242,242,242,.6);
color: #FFFFFF;
text-align: center;
}
.carousel__prev > label,
.carousel__next > label,
.carousel__prev-2 > label,
.carousel__next-2 > label,
.carousel__prev-3 > label,
.carousel__next-3 > label {
background-color: rgba(242,242,242,.3);
border-radius: 0 5px 5px 0;
cursor: pointer;
display: block;
width: 60px;
height: 60px;
position: absolute;
top: 50%;
transform: translateY(-50%);
transition: background-color 1s;
opacity: 0;
z-index: 2;
}
.carousel__next > label,
.carousel__next-2 > label,
.carousel__next-3 > label {
border-radius: 5px 0 0 5px;
}
.carousel__prev > label:hover,
.carousel__prev > label:focus,
.carousel__next > label:hover,
.carousel__next > label:focus,
.carousel__prev-2 > label:hover,
.carousel__prev-2 > label:focus,
.carousel__next-2 > label:hover,
.carousel__next-2 > label:focus,
.carousel__prev-3 > label:hover,
.carousel__prev-3 > label:focus,
.carousel__next-3 > label:hover,
.carousel__next-3 > label:focus {
background-color: rgba(242,242,242,.1);
opacity: .5 !important;
}
.carousel__prev > label:before,
.carousel__prev > label:after,
.carousel__next > label:before,
.carousel__next > label:after,
.carousel__prev-2 > label:before,
.carousel__prev-2 > label:after,
.carousel__next-2 > label:before,
.carousel__next-2 > label:after,
.carousel__prev-3 > label:before,
.carousel__prev-3 > label:after,
.carousel__next-3 > label:before,
.carousel__next-3 > label:after {
content: "";
position: absolute;
width: inherit;
height: inherit;
}
.carousel__prev > label:before,
.carousel__next > label:before,
.carousel__prev-2 > label:before,
.carousel__next-2 > label:before,
.carousel__prev-3 > label:before,
.carousel__next-3 > label:before {
background: linear-gradient(to top, rgba(255,255,255,.6) 0%, rgba(255,255,255,.6) 10%, rgba(51, 51, 51,0) 10%), linear-gradient(to left, rgba(255,255,255,.6) 0%, rgba(255,255,255,.6) 10%, rgba(51, 51, 51,0) 10%);
width: 50%;
height: 50%;
top: 20%;
transition: background 1s;
}
.carousel__prev > label,
.carousel__prev-2 > label,
.carousel__prev-3 > label {
left: 0;
}
.carousel__prev > label:before,
.carousel__prev-2 > label:before,
.carousel__prev-3 > label:before {
left: 35%;
top: 25%;
transform: rotate(135deg);
}
.carousel__next > label,
.carousel__next-2 > label,
.carousel__next-3 > label {
right: 0;
}
.carousel__next > label:before,
.carousel__next-2 > label:before,
.carousel__next-3 > label:before {
left: 10%;
top: 25%;
transform: rotate(315deg);
}
<div class="container">
<div class="carousel">
<input type="radio" id="carousel-1" name="carousel" checked>
<input type="radio" id="carousel-2" name="carousel">
<input type="radio" id="carousel-3" name="carousel">
<input type="radio" id="carousel-4" name="carousel">
<ul class="carousel__items">
<li class="carousel__item"><img src="https://i.imgur.com/W5E69l9.jpg" alt="">
<span class="caption">Passignano Sul Trasimeno</span></li>
<li class="carousel__item"><img src="https://i.imgur.com/eGbNeOB.jpg" alt="">
<span class="caption">Castello del Leone, Castiglione del Lago</span></li>
<li class="carousel__item"><img src="https://i.imgur.com/hp2OiNB.jpg" alt="">
<span class="caption">Castello Borgia, Passignano sul Trasimeno</span></li>
<li class="carousel__item"><img src="https://i.imgur.com/MHZj0eb.jpg" alt="">
<span class="caption">Castello Borgia, Passignano sul Trasimeno</span></li>
</ul>
<div class="carousel__prev">
<label for="carousel-1"></label>
<label for="carousel-2"></label>
<label for="carousel-3"></label>
<label for="carousel-4"></label>
</div>
<div class="carousel__next">
<label for="carousel-1"></label>
<label for="carousel-2"></label>
<label for="carousel-3"></label>
<label for="carousel-4"></label>
</div>
</div>
</div>
<div class="container-2">
<div class="carousel-2">
<input type="radio" id="carousel-1-2" name="carousel-2" checked>
<input type="radio" id="carousel-2-2" name="carousel-2">
<input type="radio" id="carousel-3-2" name="carousel-2">
<input type="radio" id="carousel-4-2" name="carousel-2">
<ul class="carousel__items-2">
<li class="carousel__item-2"><img src="https://i.imgur.com/S12ZVXY.jpg" alt="">
<span class="caption-2">Lago di Piediluco</span></li>
<li class="carousel__item-2"><img src="https://i.imgur.com/3JcEZp7.jpg" alt="">
<span class="caption-2">Lago di Piediluco</span></li>
<li class="carousel__item-2"><img src="https://i.imgur.com/kayLkDW.jpg" alt="">
<span class="caption-2">Lago di Piediluco</span></li>
<li class="carousel__item-2"><img src="https://i.imgur.com/gfRwbU2.jpg" alt="">
<span class="caption-2">Lago di Piediluco</span></li>
</ul>
<div class="carousel__prev-2">
<label for="carousel-1-2"></label>
<label for="carousel-2-2"></label>
<label for="carousel-3-2"></label>
<label for="carousel-4-2"></label>
</div>
<div class="carousel__next-2">
<label for="carousel-1-2"></label>
<label for="carousel-2-2"></label>
<label for="carousel-3-2"></label>
<label for="carousel-4-2"></label>
</div>
</div>
</div>
<div class="container-3">
<div class="carousel-3">
<input type="radio" id="carousel-1-3" name="carousel-3" checked>
<input type="radio" id="carousel-2-3" name="carousel-3">
<input type="radio" id="carousel-3-3" name="carousel-3">
<input type="radio" id="carousel-4-3" name="carousel-3">
<ul class="carousel__items-3">
<li class="carousel__item-3"><img src="https://i.imgur.com/W5E69l9.jpg" alt="">
<span class="caption-3">Lago di Corbara</span></li>
<li class="carousel__item-3"><img src="https://i.imgur.com/S12ZVXY.jpg" alt="">
<span class="caption-3">Lago di Corbara</span></li>
<li class="carousel__item-3"><img src="https://i.imgur.com/gfRwbU2.jpg" alt="">
<span class="caption-3">Lago di Corbara</span></li>
<li class="carousel__item-3"><img src="https://i.imgur.com/eGbNeOB.jpg" alt="">
<span class="caption-3">Lago di Corbara</span></li>
</ul>
<div class="carousel__prev-3">
<label for="carousel-1-3"></label>
<label for="carousel-2-3"></label>
<label for="carousel-3-3"></label>
<label for="carousel-4-3"></label>
</div>
<div class="carousel__next-3">
<label for="carousel-1-3"></label>
<label for="carousel-2-3"></label>
<label for="carousel-3-3"></label>
<label for="carousel-4-3"></label>
</div>
</div>
</div>
jsfiddle:https://jsfiddle.net/spf59wdc/22/
幻灯片是用纯 CSS 制作的,我重命名了每个选择器以避免冲突,但出了点问题,我不知道如何解决。
最佳答案
在某些部分,您错误地使用了 .carousel__prev-3 而不是
.carousel__next-3
body {
background-color: #000000;
}
.carousel > input[type="radio"]:nth-child(1):checked ~ .carousel__prev > label:nth-child(4),
.carousel > input[type="radio"]:nth-child(1):checked ~ .carousel__next > label:nth-child(2),
.carousel > input[type="radio"]:nth-child(2):checked ~ .carousel__prev > label:nth-child(1),
.carousel > input[type="radio"]:nth-child(2):checked ~ .carousel__next > label:nth-child(3),
.carousel > input[type="radio"]:nth-child(3):checked ~ .carousel__prev > label:nth-child(2),
.carousel > input[type="radio"]:nth-child(3):checked ~ .carousel__next > label:nth-child(4),
.carousel > input[type="radio"]:nth-child(4):checked ~ .carousel__prev > label:nth-child(3),
.carousel > input[type="radio"]:nth-child(4):checked ~ .carousel__next > label:nth-child(1),
.carousel-2 > input[type="radio"]:nth-child(1):checked ~ .carousel__prev-2 > label:nth-child(4),
.carousel-2 > input[type="radio"]:nth-child(1):checked ~ .carousel__next-2 > label:nth-child(2),
.carousel-2 > input[type="radio"]:nth-child(2):checked ~ .carousel__prev-2 > label:nth-child(1),
.carousel-2 > input[type="radio"]:nth-child(2):checked ~ .carousel__next-2 > label:nth-child(3),
.carousel-2 > input[type="radio"]:nth-child(3):checked ~ .carousel__prev-2 > label:nth-child(2),
.carousel-2 > input[type="radio"]:nth-child(3):checked ~ .carousel__next-2 > label:nth-child(4),
.carousel-2 > input[type="radio"]:nth-child(4):checked ~ .carousel__prev-2 > label:nth-child(3),
.carousel-2 > input[type="radio"]:nth-child(4):checked ~ .carousel__next-2 > label:nth-child(1),
.carousel-3 > input[type="radio"]:nth-child(1):checked ~ .carousel__prev-3 > label:nth-child(4),
.carousel-3 > input[type="radio"]:nth-child(1):checked ~ .carousel__next-3 > label:nth-child(2),
.carousel-3 > input[type="radio"]:nth-child(2):checked ~ .carousel__prev-3 > label:nth-child(1),
.carousel-3 > input[type="radio"]:nth-child(2):checked ~ .carousel__next-3 > label:nth-child(3),
.carousel-3 > input[type="radio"]:nth-child(3):checked ~ .carousel__prev-3 > label:nth-child(2),
.carousel-3 > input[type="radio"]:nth-child(3):checked ~ .carousel__next-3 > label:nth-child(4),
.carousel-3 > input[type="radio"]:nth-child(4):checked ~ .carousel__prev-3 > label:nth-child(3),
.carousel-3 > input[type="radio"]:nth-child(4):checked ~ .carousel__next-3 > label:nth-child(1) {
opacity: 1 !important;
z-index: 3;
}
*, *:before, *:after {
box-sizing: border-box;
}
.container,
.container-2,
.container-3 {
width: 100%;
margin: 0 0 10px 0;
}
.carousel,
.carousel-2,
.carousel-3 {
width: 100%;
height: 300px;
position: relative;
overflow: hidden;
}
.carousel > input[type="radio"],
.carousel-2 > input[type="radio"],
.carousel-3 > input[type="radio"] {
position: absolute;
left: 0;
opacity: 0;
top: 0;
}
.carousel > input[type="radio"]:checked ~ .carousel__items .carousel__item,
.carousel > input[type="radio"]:checked ~ .carousel__prev > label,
.carousel > input[type="radio"]:checked ~ .carousel__next > label,
.carousel-2 > input[type="radio"]:checked ~ .carousel__items-2 .carousel__item-2,
.carousel-2 > input[type="radio"]:checked ~ .carousel__prev-2 > label,
.carousel-2 > input[type="radio"]:checked ~ .carousel__next-2 > label,
.carousel-3 > input[type="radio"]:checked ~ .carousel__items-3 .carousel__item-3,
.carousel-3 > input[type="radio"]:checked ~ .carousel__prev-3 > label,
.carousel-3 > input[type="radio"]:checked ~ .carousel__next-3 > label {
opacity: 0;
}
.carousel > input[type="radio"]:nth-child(1):checked ~ .carousel__items .carousel__item:nth-child(1),
.carousel-2 > input[type="radio"]:nth-child(1):checked ~ .carousel__items-2 .carousel__item-2:nth-child(1),
.carousel-3 > input[type="radio"]:nth-child(1):checked ~ .carousel__items-3 .carousel__item-3:nth-child(1) {
opacity: 1;
}
.carousel > input[type="radio"]:nth-child(1):checked ~ .carousel__nav > label:nth-child(1),
.carousel-2 > input[type="radio"]:nth-child(1):checked ~ .carousel__nav-2 > label:nth-child(1),
.carousel-3 > input[type="radio"]:nth-child(1):checked ~ .carousel__nav-3 > label:nth-child(1) {
background: #ccc;
cursor: default;
pointer-events: none;
}
.carousel > input[type="radio"]:nth-child(2):checked ~ .carousel__items .carousel__item:nth-child(2),
.carousel-2 > input[type="radio"]:nth-child(2):checked ~ .carousel__items-2 .carousel__item-2:nth-child(2),
.carousel-3 > input[type="radio"]:nth-child(2):checked ~ .carousel__items-3 .carousel__item-3:nth-child(2) {
opacity: 1;
}
.carousel > input[type="radio"]:nth-child(2):checked ~ .carousel__nav > label:nth-child(2),
.carousel-2 > input[type="radio"]:nth-child(2):checked ~ .carousel__nav-2 > label:nth-child(2),
.carousel-3 > input[type="radio"]:nth-child(2):checked ~ .carousel__nav-3 > label:nth-child(2) {
background: #ccc;
cursor: default;
pointer-events: none;
}
.carousel > input[type="radio"]:nth-child(3):checked ~ .carousel__items .carousel__item:nth-child(3),
.carousel-2 > input[type="radio"]:nth-child(3):checked ~ .carousel__items-2 .carousel__item-2:nth-child(3),
.carousel-3 > input[type="radio"]:nth-child(3):checked ~ .carousel__items-3 .carousel__item-3:nth-child(3) {
opacity: 1;
}
.carousel > input[type="radio"]:nth-child(3):checked ~ .carousel__nav > label:nth-child(3),
.carousel-2 > input[type="radio"]:nth-child(3):checked ~ .carousel__nav-2 > label:nth-child(3),
.carousel-3 > input[type="radio"]:nth-child(3):checked ~ .carousel__nav-3 > label:nth-child(3) {
background: #ccc;
cursor: default;
pointer-events: none;
}
.carousel > input[type="radio"]:nth-child(4):checked ~ .carousel__items .carousel__item:nth-child(4),
.carousel-2 > input[type="radio"]:nth-child(4):checked ~ .carousel__items-2 .carousel__item-2:nth-child(4),
.carousel-3 > input[type="radio"]:nth-child(4):checked ~ .carousel__items-3 .carousel__item-3:nth-child(4) {
opacity: 1;
}
.carousel > input[type="radio"]:nth-child(4):checked ~ .carousel__nav > label:nth-child(4),
.carousel-2 > input[type="radio"]:nth-child(4):checked ~ .carousel__nav-2 > label:nth-child(4),
.carousel-3 > input[type="radio"]:nth-child(4):checked ~ .carousel__nav-3 > label:nth-child(4) {
background: #ccc;
cursor: default;
pointer-events: none;
}
.carousel__items,
.carousel__items-2,
.carousel__items-3 {
margin: 0;
padding: 0;
list-style-type: none;
width: 100%;
height: 600px;
position: relative;
}
.carousel__item,
.carousel__item-2,
.carousel__item-3 {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 1;
transition: opacity 2s;
}
.carousel__item img,
.carousel__item-2 img,
.carousel__item-3 img {
width: 100%;
height: 300px;
vertical-align: middle;
}
.carousel__item .caption,
.carousel__item-2 .caption-2,
.carousel__item-3 .caption-3 {
position: absolute;
width: 100%;
top: 43.4%;
left: 0;
margin: 0;
padding: 5px 0 15px 0;
background-color: rgba(242,242,242,.6);
color: #FFFFFF;
text-align: center;
}
.carousel__prev > label,
.carousel__next > label,
.carousel__prev-2 > label,
.carousel__next-2 > label,
.carousel__prev-3 > label,
.carousel__next-3 > label {
background-color: rgba(242,242,242,.3);
border-radius: 0 5px 5px 0;
cursor: pointer;
display: block;
width: 60px;
height: 60px;
position: absolute;
top: 50%;
transform: translateY(-50%);
transition: background-color 1s;
opacity: 0;
z-index: 2;
}
.carousel__next > label,
.carousel__next-2 > label,
.carousel__next-3 > label {
border-radius: 5px 0 0 5px;
}
.carousel__prev > label:hover,
.carousel__prev > label:focus,
.carousel__next > label:hover,
.carousel__next > label:focus,
.carousel__prev-2 > label:hover,
.carousel__prev-2 > label:focus,
.carousel__next-2 > label:hover,
.carousel__next-2 > label:focus,
.carousel__prev-3 > label:hover,
.carousel__prev-3 > label:focus,
.carousel__next-3 > label:hover,
.carousel__next-3 > label:focus {
background-color: rgba(242,242,242,.1);
opacity: .5 !important;
}
.carousel__prev > label:before,
.carousel__prev > label:after,
.carousel__next > label:before,
.carousel__next > label:after,
.carousel__prev-2 > label:before,
.carousel__prev-2 > label:after,
.carousel__next-2 > label:before,
.carousel__next-2 > label:after,
.carousel__prev-3 > label:before,
.carousel__prev-3 > label:after,
.carousel__next-3 > label:before,
.carousel__next-3 > label:after {
content: "";
position: absolute;
width: inherit;
height: inherit;
}
.carousel__prev > label:before,
.carousel__next > label:before,
.carousel__prev-2 > label:before,
.carousel__next-2 > label:before,
.carousel__prev-3 > label:before,
.carousel__next-3 > label:before {
background: linear-gradient(to top, rgba(255,255,255,.6) 0%, rgba(255,255,255,.6) 10%, rgba(51, 51, 51,0) 10%), linear-gradient(to left, rgba(255,255,255,.6) 0%, rgba(255,255,255,.6) 10%, rgba(51, 51, 51,0) 10%);
width: 50%;
height: 50%;
top: 20%;
transition: background 1s;
}
.carousel__prev > label,
.carousel__prev-2 > label,
.carousel__prev-3 > label {
left: 0;
}
.carousel__prev > label:before,
.carousel__prev-2 > label:before,
.carousel__prev-3 > label:before {
left: 35%;
top: 25%;
transform: rotate(135deg);
}
.carousel__next > label,
.carousel__next-2 > label,
.carousel__next-3 > label {
right: 0;
}
.carousel__next > label:before,
.carousel__next-2 > label:before,
.carousel__next-3 > label:before {
left: 10%;
top: 25%;
transform: rotate(315deg);
}
<div class="container">
<div class="carousel">
<input type="radio" id="carousel-1" name="carousel" checked>
<input type="radio" id="carousel-2" name="carousel">
<input type="radio" id="carousel-3" name="carousel">
<input type="radio" id="carousel-4" name="carousel">
<ul class="carousel__items">
<li class="carousel__item"><img src="https://i.imgur.com/W5E69l9.jpg" alt="">
<span class="caption">Passignano Sul Trasimeno</span></li>
<li class="carousel__item"><img src="https://i.imgur.com/eGbNeOB.jpg" alt="">
<span class="caption">Castello del Leone, Castiglione del Lago</span></li>
<li class="carousel__item"><img src="https://i.imgur.com/hp2OiNB.jpg" alt="">
<span class="caption">Castello Borgia, Passignano sul Trasimeno</span></li>
<li class="carousel__item"><img src="https://i.imgur.com/MHZj0eb.jpg" alt="">
<span class="caption">Castello Borgia, Passignano sul Trasimeno</span></li>
</ul>
<div class="carousel__prev">
<label for="carousel-1"></label>
<label for="carousel-2"></label>
<label for="carousel-3"></label>
<label for="carousel-4"></label>
</div>
<div class="carousel__next">
<label for="carousel-1"></label>
<label for="carousel-2"></label>
<label for="carousel-3"></label>
<label for="carousel-4"></label>
</div>
</div>
</div>
<div class="container-2">
<div class="carousel-2">
<input type="radio" id="carousel-1-2" name="carousel-2" checked>
<input type="radio" id="carousel-2-2" name="carousel-2">
<input type="radio" id="carousel-3-2" name="carousel-2">
<input type="radio" id="carousel-4-2" name="carousel-2">
<ul class="carousel__items-2">
<li class="carousel__item-2"><img src="https://i.imgur.com/S12ZVXY.jpg" alt="">
<span class="caption-2">Lago di Piediluco</span></li>
<li class="carousel__item-2"><img src="https://i.imgur.com/3JcEZp7.jpg" alt="">
<span class="caption-2">Lago di Piediluco</span></li>
<li class="carousel__item-2"><img src="https://i.imgur.com/kayLkDW.jpg" alt="">
<span class="caption-2">Lago di Piediluco</span></li>
<li class="carousel__item-2"><img src="https://i.imgur.com/gfRwbU2.jpg" alt="">
<span class="caption-2">Lago di Piediluco</span></li>
</ul>
<div class="carousel__prev-2">
<label for="carousel-1-2"></label>
<label for="carousel-2-2"></label>
<label for="carousel-3-2"></label>
<label for="carousel-4-2"></label>
</div>
<div class="carousel__next-2">
<label for="carousel-1-2"></label>
<label for="carousel-2-2"></label>
<label for="carousel-3-2"></label>
<label for="carousel-4-2"></label>
</div>
</div>
</div>
<div class="container-3">
<div class="carousel-3">
<input type="radio" id="carousel-1-3" name="carousel-3" checked>
<input type="radio" id="carousel-2-3" name="carousel-3">
<input type="radio" id="carousel-3-3" name="carousel-3">
<input type="radio" id="carousel-4-3" name="carousel-3">
<ul class="carousel__items-3">
<li class="carousel__item-3"><img src="https://i.imgur.com/W5E69l9.jpg" alt="">
<span class="caption-3">Lago di Corbara</span></li>
<li class="carousel__item-3"><img src="https://i.imgur.com/S12ZVXY.jpg" alt="">
<span class="caption-3">Lago di Corbara</span></li>
<li class="carousel__item-3"><img src="https://i.imgur.com/gfRwbU2.jpg" alt="">
<span class="caption-3">Lago di Corbara</span></li>
<li class="carousel__item-3"><img src="https://i.imgur.com/eGbNeOB.jpg" alt="">
<span class="caption-3">Lago di Corbara</span></li>
</ul>
<div class="carousel__prev-3">
<label for="carousel-1-3"></label>
<label for="carousel-2-3"></label>
<label for="carousel-3-3"></label>
<label for="carousel-4-3"></label>
</div>
<div class="carousel__next-3">
<label for="carousel-1-3"></label>
<label for="carousel-2-3"></label>
<label for="carousel-3-3"></label>
<label for="carousel-4-3"></label>
</div>
</div>
</div>
关于html - 同一 HTML 页面上有超过 1 个幻灯片,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48792825/
我使用这个 cmd 应用程序 https://github.com/tokland/youtube-upload 上传 50 个视频后,我收到此错误: [RequestError] Server re
尝试将 docker 容器提交到镜像时出现错误: [root@dockerregistry /]# docker commit da4180ab1536 dockerregistry:5000/myi
我只是想知道这样做会更好吗: if((fd = open(filename, O_RDWR)) == -1) { fprintf(stderr, "open [ %s ]\n", strerror(e
我在我的开发机器(单个笔记本)中使用 Elasticsearch 1.4.4。一切都设置为默认值,因为我从未更改过任何设置。 当我启动它时,我通常会收到以下消息: [2015-10-27 09:38:
我收到错误 Lock wait timeout exceeded;尝试重新启动事务。这是什么原因,如何解决?仅供引用:MySQL 配置文件中的 innodb_lock_wait_timeout = 1
我对 Slack 中的 block 功能有疑问。有人设法构建 3 列而不是 2 列吗? 我凭直觉尝试了以下代码,但它不起作用: { "blocks": [ {
div 中的内容超过由 css 决定的固定大小。 #fixeddiv { position: fixed; margin: auto; max-height: 300px
我想将 EditText 字段限制为 150 个字符,我可以很容易地做到这一点。但是,当用户试图超过该限制时,我还需要通过键入(即第 151 个字符)或粘贴超过 150 个字符来提醒用户。 解决这个问
我目前正在使用此代码并排记录两个窗口: ffmpeg -f gdigrab -framerate 30 -i title="" -f gdigrab -framerate 30 -i title=""
我在几个包含长字符串的单元格上使用嵌套的 SUBSTITUE 函数,并定期更新 SUBSTITUE fx,这导致我将其复制并粘贴到所有需要它的单元格中。问题是,我的 SUBSTITUTE 列表会随着时
我创建了一个标题 div,如下所示:
Here is the demo link 您怎么看,页面中只有 8 个广告可见,但我有 14 个广告。我已阅读有关广告限制的信息 here但不明白是不是我的情况?有人可以给我确切的答案,为什么我看不
我的非常简单的算法 - C 中的快速排序有问题。它非常有效(随机化大约 0.1 秒并检查列表是否已排序)但是当我想要对超过 500k 的元素进行排序时它会崩溃。不幸的是,我需要对它们进行更多排序,因为
我成功解决了一个关于 Hackerrank 的问题,它通过了所有测试用例,但我得到了一个错误,超过了时间限制。我猜如果我优化我的代码它会工作,但我想不出任何方法来使我的代码更有效率。 问题是: 对大小
你会如何用 包围下面的文字3 个反引号 ```使用 tpope 的 Vim Surround . 我所能做的就是 1 个反引号 使用 S`在视觉模式下: 最佳答案 这不是你问的,但这可以在没有环绕的情
我目前有一个模拟账户。我正在尝试为我的雇主使用 SwifType 制作 POC。我们有一个非常大的数据库,每 1 小时索引一次,并创建一个 JSON 文件。我认为与 Elastic 的集成将非常容易,
我为一个大约有 100 到 120 名成员的小型组织维护网站。 每个月,我们都会发送一封电子邮件,通知我们的成员我们将在即将举行的 session 中讨论的主题。 我正在尝试使用我们的网站为我们提供一
这个问题已经有答案了: How to automatically input an array formula as string with more than 255 characters in l
我有一个在 JBoss 6.1 中运行的 JSF 应用程序,它使用内部Tomcat Servlet 容器。 我已经通过apache commons文件上传实现了上传。我想防止上传过大的文件并设置了属性
当我尝试在 PyMySQL 上执行查询时,出现以下错误: pymysql.err.InternalError: (1205, 'Lock wait timeout exceeded; try rest
我是一名优秀的程序员,十分优秀!