As I work on creating my personal website, I have encountered an issue with three elements that are supposed to be side-by-side. My desired structure is depicted in this link: https://i.sstatic.net/eQEf3.jpg
However, the middle element is not responding to margin adjustments as expected. For instance, setting "margin-left" does not seem to have any impact at all.
You can see how my website currently looks here: https://i.sstatic.net/YuHs6.jpg
I am starting to realize that I may need a deeper understanding of HTML and its semantics rather than just experimenting with different tags. Does anyone have any advice or recommendations on this matter? It's worth mentioning that I have taught myself HTML, CSS, and now JavaScript through free resources like freecodecamp.org.
I have attempted floating the outer elements left and right respectively, while centering the middle one. However, the center element is behaving strangely by being positioned higher (with a greater margin-top value compared to the other two).
Below is the section of code relevant to these three elements:
<div class="Services1">
<h2> Fine Art and Calligraphy</h2>
<a href="sites/blog.html">
<img src="images/FineArts.png" id="Fine">
</a>
</div>
<div class="Service2">
<h2> Chess and Mathematics Tutoring</h2>
<a href="sites/services.html">
<img src="images/Math.png" style="width: 300px">
</a>
</div>
<div class="Services3">
<h2> Web Dev and Design </h2>
<a href="sites/services.html">
<img src="images/Web-Developer-Skills-1.jpg" style="width: 400px;">
</a>
</div>
The corresponding CSS for these elements is:
.Services1 {
float: left;
padding: 20px;
border: 5px solid red;
text-align: center
}
.Services2 {
display: inline-block;
margin: 20px;
}
.Services3 {
float: right;
margin-top: -330px;
margin-right: 90px;
border: 5px solid red;
text-align: center;
}
I have experimented with float: center;
for the middle element without success. Margins also do not seem to work correctly, and the element appears stuck to the left one. This behavior seems quite puzzling.