I am struggling with centering the image that appears after clicking on a cropped image in my image gallery. Here is my current code:
The images below showcase my issue:
<!DOCTYPE html>
<html lang="en>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>
.grid-container {
margin: auto;
max-height: 600px;
max-width: 1400px;
display: grid;
grid-template-columns: 1fr 1fr;
grid-template-rows: 1fr 1fr;
}
.little-finger-klein {
height: 300px;
width: 700px;
background: url('https://un-aesthetic.com/wp-content/uploads/2020/11/little-finger-klein.png') no-repeat;
}
.little-finger-gross {
position: absolute;
height: 600px;
width: 1400px;
background: url('https://un-aesthetic.com/wp-content/uploads/2020/11/little-finger-ganz.png') no-repeat;
}
.justate-klein {
height: 300px;
width: 700px;
background: url('https://un-aesthetic.com/wp-content/uploads/2020/11/just-ate-klein.png') no-repeat;
}
.justate-gross {
<style and script continue...