Я хочу разместить значок (что-то вроде this ) поверх моей сетки изображений flexbox в моем проекте, но я не могу понять, как это сделать.Было бы предпочтительнее, если бы на значок можно было кликать, чтобы при клике изображение получалось большим или похожим.Может ли кто-нибудь помочь с этим?Спасибо!
Вот мой код:
@import url('https://fonts.googleapis.com/css?family=Montserrat');
.heading {
display: inline-block;
font-family: "Montserrat";
font-weight: lighter;
text-align: left;
margin-left: 20vw;
line-height: 30vw;
}
body {
width: 100%;
margin: auto;
font-family: 'Montserrat', sans-serif;
background-color: white;
}
.container {
display: flex;
flex-wrap: wrap;
flex-direction: row;
justify-content: center;
margin-top: 30px;
flex-flow: row wrap;
margin-top: -10vw;
}
.galleryimg {
margin: 9px;
transition: filter 0.2s;
filter: brightness(100%);
display: inline-block;
min-height: 100px;
height: 50vh;
}
.galleryimg:hover {
filter: brightness(80%);
}
.responsive:hover {
}
header {
position: relative;
height: 50vh;
background-image: linear-gradient(rgb(50, 50, 50), rgb(30, 30, 30));
margin-top: -20px;
transform: skewY(-5deg);
transform-origin: top left;
}
.fullwidth {
width: 100%;
}
.headertitle {
margin-top: -36vh;
margin-left: 12vw;
position: absolute;
font-size: calc(13px + 2.5vw);
color: white;
font-family: 'Montserrat';
font-weight: lighter;
}
/* navbar */
nav {
background: rgb(52, 52, 52);
position: relative;
z-index: 1;
height: calc(18px + 6vh);
box-shadow: 0 3px 3px -1px rgba(0, 0, 0, 0.065);
overflow: auto;
width: 100vw;
}
nav ul {
margin: 0;
padding: 0;
text-align: left;
margin-left: 3.2vw;
}
nav ul li {
display: inline-block;
list-style: none;
font-size: 1.2em;
padding: 1vh;
}
.navul a {
text-decoration: none;
color: white;
line-height: 5.5vh;
height: 5.5vh;
font-size: calc(15px + 0.25vh + 0.15vw);
}
.navuul a:visited, a:link, a:active
{
text-decoration: none;
color: white;
font-weight: 200;
line-height: 5.5vh;
height: 5.5vh;
}
.navuul a:hover
{
text-decoration: none;
color: grey;
font-weight: 200;
line-height: 5.5vh;
height: 5.5vh;
}
.submit {
float: right;
margin-right: 1.5vw;
}
.submit a {
color: white;
border-radius: 5px;
}
.navimgdiv img {
width: 0.8vw;
}
.navimgdiv {
padding: 5px 0;
padding-left: 0.5vw;
float: left;
margin-left: 1vw;
}
.navimgdiv img :hover {
filter: brightness(100%);
}
.navimgdiv a:visited, a:link, a:active {
text-decoration: none;
color: grey;
font-weight: 200;
line-height: 5.5vh;
height: 5.5vh;
}
/* navbar end */
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="pgallerystyles.css">
<title> Photo Gallery </title>
<link rel="shortcut icon" href="logo.png">
</head>
<body>
<div class="fullwidth"></div>
<nav>
<a href="#" class="navimgdiv"><img src="logo.svg">Lumastock</a>
<ul class="navul">
<li><a href="#">Photos</a></li>
<li><a href="#">Featured</a></li>
<li><a href="#"> Contact</a></li>
<li><a href="#">Pricing</a></li>
<li><a href="#">Assesment Requirements</a></li>
<li class="submit"><a href="#">Submit a photo</a></li>
</ul>
</nav>
<header></header>
<h1 class="headertitle">Image Gallery</h1>
<main class="site-wrapper">
<div class="container">
<div class="responsive"><img class="galleryimg" src="https://via.placeholder.com/600x400.jpg"></div>
<div class="responsive"><img class="galleryimg" src="https://via.placeholder.com/400x600.jpg"></div>
<div class="responsive"><img class="galleryimg" src="https://via.placeholder.com/400x600.jpg"></div>
<div class="responsive"><img class="galleryimg" src="https://via.placeholder.com/600x400.jpg"></div>
<div class="responsive"><img class="galleryimg" src="https://via.placeholder.com/600x400.jpg"></div>
<div class="responsive"><img class="galleryimg" src="https://via.placeholder.com/600x400.jpg"></div>
<div class="responsive"><img class="galleryimg" src="https://via.placeholder.com/600x400.jpg"></div>
<div class="responsive"><img class="galleryimg" src="https://via.placeholder.com/600x400.jpg"></div>
</div>
</main>
</body>
</html>
Скриншот сайта: 