Reputation: 47
I have three images that I am trying to align with display: flex
, I see that those div's interfere with each other, I just can't get them to go side by side with another, so those divs overlap.
I made a JSFiddle to explain it better here.
.top-section-hover {
display: flex;
padding-top: 10em;
justify-content: center;
flex-grow: 2;
text-align: center;
text-transform: uppercase;
font-weight: bold;
max-width: 96%;
}
.top-section-hover img {
position: relative;
top: 0;
transition: top ease 0.5s;
left: 0;
}
.top-section-hover img.active {
top: -30px;
transition: all 0.5s ease;
}
.cover-title {
font-weight: bold;
}
.top-section-hover span.active2 {
color: white;
border-bottom: 3px solid white;
transition: 0.5s all;
}
<div class="top-section-hover">
<span class="hover-cover-left">
<a href="#" class="cover-left-content">
<img src="https://www.4metri.lv/upload/iblock/95c/95c14a70011a4c90c37656d71c1c7f43.png" alt="" class="cover-img">
<span class="cover-title">Birojam</span>
</a>
</span>
<span class="hover-cover-middle">
<a href="#" class="cover-left-content">
<img src="https://www.4metri.lv/upload/iblock/28e/28e0b8c52db48dd56e0c0bfcccb445ff.png" alt="" class="cover-img">
<span class="cover-title">Mājai</span>
</a>
</span>
<span class="hover-cover-right">
<a href="#" class="cover-left-content">
<img src="http://4metri.lan/public/..\resources\images\4metribildelabi.png" alt="" class="cover-img">
<span class="cover-title">Pasākumiem</span>
</a>
</span>
</div>
</div>
This is the desired state, they all ling up side by side
Upvotes: 0
Views: 71
Reputation: 9769
Are you looking like this?
.top-section-hover {
display: flex;
padding-top: 10em;
justify-content: space-around;
flex-grow: 2;
text-align: center;
text-transform: uppercase;
font-weight: bold;
max-width: 96%;
}
.top-section-hover img {
position: relative;
top: 0;
transition: top ease 0.5s;
left: 0;
width: 100%;
height: 100px;
}
.top-section-hover img.active {
top: -30px;
transition: all 0.5s ease;
}
.cover-title {
font-weight: bold;
}
.top-section-hover span.active2 {
color: white;
border-bottom: 3px solid white;
transition: 0.5s all;
}
<div class="top-section-hover">
<span class="hover-cover-left">
<a href="#" class="cover-left-content">
<img src="https://www.4metri.lv/upload/iblock/95c/95c14a70011a4c90c37656d71c1c7f43.png" alt="" class="cover-img">
<span class="cover-title">Birojam</span>
</a>
</span>
<span class="hover-cover-middle">
<a href="#" class="cover-left-content">
<img src="https://www.4metri.lv/upload/iblock/28e/28e0b8c52db48dd56e0c0bfcccb445ff.png" alt="" class="cover-img">
<span class="cover-title">Mājai</span>
</a>
</span>
<span class="hover-cover-right">
<a href="#" class="cover-left-content">
<img src="https://www.4metri.lv/upload/iblock/95c/95c14a70011a4c90c37656d71c1c7f43.png" alt="" class="cover-img">
<span class="cover-title">Pasākumiem</span>
</a>
</span>
</div>
Upvotes: 1
Reputation: 179
.top-section-hover {
display: flex;
padding-top: 10em;
justify-content: center;
flex-grow: 2;
text-align: center;
text-transform: uppercase;
font-weight: bold;
max-width: 96%;
align-items:center
}
Upvotes: 0