Edrol97
Bronze Coder
Hi All,
Trying to position arrows wrapping around an html gallery I've made but I can only seem to get them either both on one side of the image, centred in the middle of the page or on extremes of the page. This is what I've got currently.
My html is as follows
And my CSS looks like this:
Trying to position arrows wrapping around an html gallery I've made but I can only seem to get them either both on one side of the image, centred in the middle of the page or on extremes of the page. This is what I've got currently.
My html is as follows
HTML:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Image carousel</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<div class="container">
<img src="img/Slide%20away.png" alt=" "width="300px" onclick="LaunchLightbox()">
</div>
<div class="slide-show_container">
<div class="next_button" onclick="NextImage()">⟹</div>
<div class="previous_button" onclick="PreviousImage()">⟸</div>
<div class="close_button" onclick="CloseLightbox()">✗</div>
<div class="image_slide" onclick="slides()"></div>
<div class="image_slide">
<img src="img/A%20Bit%20Of%20A%20Mix%20Up.png" width="300px">
<div class="caption_text">Rishi's getting a bit mixed up</div>
</div>
<div class="image_slide">
<img src="img/Culture%20War%20On%20Woke.png" width="300px">
<div class="caption_text">The Tories are looking for an election strategy</div>
</div>
<div class="image_slide">
<img src="img/Nothing%20to%20see%20here.png" width="300px">
<div class="caption_text">The Tories are looking for an election strategy</div>
</div>
<div class="image_slide">
<img src="img/Out%20of%20Tune%20ideas.png" width="300px">
<div class="caption_text">No ideas incoming</div>
</div>
<div class="image_slide">
<img src="img/Budget%20Fare.png" width="300px">
<div class="caption_text">One way ticket to nowhere for the Tories</div>
</div>
<div class="image_slide">
<img src="img/That's%20Racist.png" width="500px">
<div class="caption_text">The Frank Hester row wages on, as the Tories are embroiled in a racism row</div>
</div>
<div class="image_slide">
<img src="img/Bad%20Times%20logo%20Colourised%20W.png" width="300px">
<div class="caption_text">Bad Times continue with the Tories</div>
</div>
<div class="image_slide">
<img src="img/Budget%20Budget.png" width="300px">
<div class="caption_text">This budget won't stretch far</div>
</div>
<div class="image_slide">
<img src="img/Vultures%20Circling.png" width="300px">
<div class="caption_text">Rishi doesn't have long if the 1922 Committee have anything to do about it</div>
<button class="w3-button w3-black w3-display-left" onclick="plusDivs(-1)">❮</button>
<button class="w3-button w3-black w3-display-right" onclick="plusDivs(1)">❯</button>
</div>
</div>
</div>
</div slide-show_container>
</div>
<script src="script.js"></script>
</body>
</html>
And my CSS looks like this:
CSS:
@font-face {
font-family: Eliot Lord;
src: url(Fonts/EliotlordhandRegular.ttf);
}
body
{
font-family: Eliot Lord;
}
.caption_text{
font-size: 20pt;
}
.next_button{
font-family: Arial, Helvetica, sans-serif;
font-size: large;
float: right;
}
.previous_button{
font-family: Arial, Helvetica, sans-serif;
font-size: large;
float: left;
}
.image_slide{
display: none;
}
.slide-show_container{
display: flex;
align-items: center;
justify-content: center;
min-height: 100vh;
text-align: center;
}
.image_slide{
height: 400px;
width: 700px;
overflow: hidden;
position:relative
}
.caption_text{
height: 100%;
width: 100%;
}
.w3-btn-floating > img {
position:absolute;
top:50%;
left:50%;
transform:translate(-50%, -50%);
height: 45px;
width: 45px;
color: white;
}
.w3-btn-floating {
position:absolute;
top:50%;
transform:translateY(-50%);
height: 45px;
width: 45px;
color: white;
}
#prev {
margin-right:10px;
right:100px;
}
#next {
margin-left:10px;
left:100px;
}
.slide-show_container {
display: none;
}