I have cards with team members, where is name, position and some description. The cards are flex items.
I put profile picture as a ::before element and positioned it in the middle top of the flex item so it looks like this:
The problem is - between breakpoints 430 and 790px, it is not in the middle - it looks like this:
My code is:
.card-team-member {
--profile-img-height: calc(var(--breakpoint_unit) * calc(80*var(--basic_unit)));
flex-basis: calc(var(--breakpoint_unit) * calc(190*var(--basic_unit)));
box-shadow: 0 0 8px rgba(0, 0, 0, 0.2);
padding: calc(var(--breakpoint_unit) * calc(10*var(--basic_unit))) calc(var(--breakpoint_unit) * calc(15*var(--basic_unit)));
margin-bottom: calc(var(--profile-img-height) - 1%);
position: relative;
}
.card-team-member::before {
content: "";
border-radius: 50%;
position: absolute;
left: calc(100% - calc(var(--breakpoint_unit) * calc(125*var(--basic_unit))));
top: calc(var(--breakpoint_unit) * calc(-55*var(--basic_unit)));
width: calc(var(--breakpoint_unit) * calc(80*var(--basic_unit)));
height: var(--profile-img-height);
box-shadow: 0 0 8px rgba(0, 0, 0, 0.4);
}
:root {
--basic_unit: 0.5vw;
--breakpoint_unit: 1;
}
@media (min-width: 430px) {
:root {
--breakpoint_unit: 0.8;
}
}
@media (min-width: 570px) {
:root {
--breakpoint_unit: 0.6;
}
}
@media (min-width: 790px) {
:root {
--breakpoint_unit: 0.5;
}
}
<section class="section-about-us-team">
<div class="section-container about-us">
<div class="div-team-member">
<div class="card-team-member one">
<h5>Name Surname</h5>
<h6>CEO</h6>
<p>text</p>
</div>
<div class="card-team-member two">
<h5>Name Surname</h5>
<h6>IT</h6>
<p>text</p>
</div>
<div class="card-team-member three">
<h5>Name Surname</h5>
<h6>IT</h6>
<p>text</p>
</div>
</div>
</div>
</section>
Do you have any ideas why is it not working? Thanks a lot!