我會給你看我做的和弦
<!DOCTYPE html>
<html lang="ko">
<head>
<meta charset="UTF-8">
<title>?????</title>
<style>
body{
margin: 0;
}
.event_slide input[id*=slide]{
display: none;
}
.event_slide .slidewrap{
max-width: 1200px ;
margin:0 auto;
overflow: hidden;
}
.event_slide .slidelist{
white-space:nowrap;
font-size: 0;
}
.event_slide .slidelist > li {
display: inline-block;
vertical-align: middle;
width: 100%;
transition:all .5s;
}
.event_slide .slidelist > li > a {
display:block;
position:relative;
}
.event_slide .slidelist > li > a img {
width: 100%;
}
.event_slide .slidelist label {
position: absolute;
z-index: 10;
top: 50%;
transform: translateY(-50%);
padding: 50px;
cursor: pointer;
}
.event_slide .slidelist .left {
left: 30px;
background: url(images/index/header02/slide/left.png) center center / 100% no-repeat;
}
.event_slide .slidelist .right {
right : 30px;
background: url(images/index/header02/slide/right.png) center center / 100% no-repeat;
}
.event_slide [id="slide01"]:checked ~ .slidewrap .slidelist > li {transform: :translateX(0%);
}
.event_slide [id="slide02"]:checked ~ .slidewrap .slidelist > li {transform: :translateX(-100%);
}
.event_slide [id="slide03"]:checked ~ .slidewrap .slidelist > li {transform: :translateX(-200%);
}
.event_slide [id="slide04"]:checked ~ .slidewrap .slidelist > li {transform: :translateX(-300%);
}
</style>
</head>
<body>
<div class="event_slide">
<input type="radio" name="slide" id="slide01" checked>
<input type="radio" name="slide" id="slide02">
<input type="radio" name="slide" id="slide03">
<input type="radio" name="slide" id="slide04">
<div class="slidewrap">
<ul class="slidelist">
<li>
<a>
<label for="slide04" class="left"></label>
<img src="images/index/header02/slide/slide01.png">
<label for="slide02" class="right"></label>
</a>
</li>
<li>
<a>
<label for="slide01" class="left"></label>
<img src="images/index/header02/slide/slide02.png">
<label for="slide03" class="right"></label>
</a>
</li>
<li>
<a>
<label for="slide02" class="left"></label>
<img src="images/index/header02/slide/slide03.png">
<label for="slide04" class="right"></label>
</a>
</li>
<li>
<a>
<label for="slide03" class="left"></label>
<img src="images/index/header02/slide/slide04.png">
<label for="slide01" class="right"></label>
</a>
</li>
</ul>
</div><!--slidewrap end-->
</div><!--event_slide end-->
</body>
</html>
我沒有寫javascript,我只是想寫一個代碼,當(dāng)我只使用CSS按下箭頭時,它會覆蓋圖像。 但是在風(fēng)格上
.event_slide .slidelist .right {
right : 30px;
background: url(images/index/header02/slide/right.png) center center / 100% no-repeat;
subsequent
.event_slide [id="slide01"]:checked ~ .slidewrap .slidelist > li {transform: :translateX(0%);
}
.event_slide [id="slide02"]:checked ~ .slidewrap .slidelist > li {transform: :translateX(-100%);
}
.event_slide [id="slide03"]:checked ~ .slidewrap .slidelist > li {transform: :translateX(-200%);
}
.event_slide [id="slide04"]:checked ~ .slidewrap .slidelist > li {transform: :translateX(-300%);
}
圖像未通過,因為未應(yīng)用。 我應(yīng)該修理什么?
在此輸入圖像描述
我想通過按下兩邊的箭頭來滑動圖像