1
Guys, I’m still a beginner, but I managed to make a 'gallery' for me, but I’m having difficulty putting an image and text on the items in this gallery. As you can see in the code below, when I define a HEIGHT, there is a huge border over between the first and the second line. Could someone help me? I looked for answers here, but I couldn’t implement them. I want to get the mask image to be the right size and position on each item, and the text, when I figure that out, I can try to line it up right. And I created a gallery so, and in it I was able to deploy it correctly, but it was limited.
<!DOCTYPE html>
<html>
<head>
<style>
body {
margin:2px;
padding:0px;
background: RGB(25, 25, 25);
}
div.gallery img {
width: 100%;
height: 100%;
}
div.texto {
position:relative;
width: 100%;
height: 50px;
overflow: hidden;
top:-600px;
color: gray;
text-overflow: '...';
text-align: center;
font: bold 14px arial, sans-serif;
background-color:green;
}
div.imagem-mascara {
position:relative;
width:100%;
height:500px;
top:-535px;
background:url(https://uploaddeimagens.com.br/images/000/842/601/original/Sombra.png) 0 0 no-repeat;
background-size: 100% 100%;
float: left;
}
* {
box-sizing: border-box;
}
.responsive {
padding: 0 1px;
float: left;
width: 25%;
}
@media only screen and (max-width: 700px){
.responsive {
width: 33.3%;
margin: 3px 0;
}
}
@media only screen and (max-width: 500px){
.responsive {
width: 33.3%;
}
}
</style>
</head>
<body>
<meta name="viewport" content="width=device-width, user-scalable=no" /> </meta>
<div class="responsive">
<div class="gallery">
<img src="https://uploaddeimagens.com.br/images/000/971/036/full/1.jpeg">
</div>
<div class="imagem-mascara" id="Naruto" onclick="Anime(this)"></div>
<div class="texto">Texto</div>
</div>
<div class="responsive">
<div class="gallery">
<img src="https://uploaddeimagens.com.br/images/000/971/038/full/2.jpeg">
</div>
<div class="imagem-mascara" id="Naruto" onclick="Anime(this)"></div>
<div class="texto">Texto</div>
</div>
</div>
<div class="responsive">
<div class="gallery">
<img src="https://uploaddeimagens.com.br/images/000/971/039/full/3.jpeg">
<div class="imagem-mascara" id="Naruto" onclick="Anime(this)"></div>
<div class="texto">Texto</div>
</div>
</div>
<div class="responsive">
<div class="gallery">
<img src="https://uploaddeimagens.com.br/images/000/971/041/full/4.jpeg">
<div class="imagem-mascara" id="Naruto" onclick="Anime(this)"></div>
<div class="texto">Texto</div>
</div>
</div>
<div class="responsive">
<div class="gallery">
<img src="https://uploaddeimagens.com.br/images/000/971/039/full/3.jpeg" >
<div class="imagem-mascara" id="Naruto" onclick="Anime(this)"></div>
<div class="texto">Texto</div>
</div>
</div>
</body>
</html>
I don’t understand what your specific problem is. I’ve noticed that there are some mistakes, but which exactly are you needing help with?
– Leon Freire
There’s an image-mask div that I want to overlay every item in the gallery, but when an element descends into the gallery, there’s a huge edge between the first and second row.
– David Benner