Я пробовал переупорядочить элемент кнопки и возиться с JS. код. В целом, я думаю, что проблема может быть связана с CSS.
Вот соответствующий фрагмент кода:
Код: Выделить всё
function togglePopup() {
document.getElementById("popup-1").classList.toggle("active");
}Код: Выделить всё
.photo-gallery {
width: 90%;
margin: auto;
display: grid;
grid-template-columns: repeat(4, 1fr);
grid-gap: 20px;
}
.pic {
margin-top: 130px;
position: relative;
height: 230px;
border-radius: 10px;
box-shadow: 3px 3px 5px lightgray;
cursor: pointer;
}
.pic img {
width: 100%;
height: 100%;
border-radius: 10px;
}
.website::before {
content: "This website!";
text-align: center;
}
.popup .overlay {
position: fixed;
top: 0px;
left: 0px;
width: 100vw;
height: 100vh;
background: rgba(0, 0, 0, 0.7);
z-index: 1;
}
.popup {
display: none;
}
.popup .content {
position: absolute;
top: 50%;
left: 50%;
transform: translateY(-50%);
background: #fff;
width: 450px;
height: 220px;
z-index: 2;
text-align: center;
padding: 20px;
box-sizing: border-box;
}
.popup .close-btn {
cursor: pointer;
position: absolute;
right: 20px;
top: 20px;
width: 30px;
height: 30px;
background: #222;
color: #fff;
font-size: 25px;
font-weight: 600;
line-height: 30px;
text-align: center;
border-radius: 50%;
}
.popup.active .overlay {
display: block;
}
.popup.active .content {
transition: all 300ms ease-in-out;
transform: translate(-50%, -50%) scale(1);
}Код: Выделить всё
[img]C:\Users\Marks\Desktop\portfolio
×
Title
weeeeeeeewooooooooooo
Подробнее здесь: https://stackoverflow.com/questions/793 ... to-gallery
Мобильная версия