I'm making a website in wordpress.com and I'm trying to figure out how to control where an image is placed? Currently I can only place an image below or above another and it looks really messy. Is there a way to control the coordinates using html or CSS? Preferably html because I want different positions for different images.
Here is the code of my images so far:
.container {
position: relative;
width: 400px;
}
.image {
display: block;
width: 100%;
height: auto;
}
.overlay {
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
height: 100%;
width: 100%;
opacity: 0;
transition: .5s ease;
background-color: #008CBA;
}
.container:hover .overlay {
opacity: 1;
}
.projeto01 {
color: white;
font-size: 40px;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
-ms-transform: translate(-50%, -50%);
text-align: center;
}
<div class="grid-portefolio">
<div class="container">
<a href="https://en.wikipedia.org/wiki/Main\_Page"><img src="https://insert1australia.files.wordpress.com/2021/04/real-sinister-minister-14-250x250-1-1.png" class="image" alt="Albert Lee Banks Electorate"/><div class="overlay"><div class="projeto01">Albert Lee<br>Banks Electorate</div></div></a>
</div>
Also note that I'm a beginner at programming. The code above is a mix of templates I found online and some help from a friend.
You can use
margin
property of css, or I tried it myself, and there might be some other css code overlapping yours since when I changed the width of my three images, they appeared on one lineEdit: @MrMcGoofy, the example code is: