This is my first post here... so hopefully I get all of the necessary info in this question.
I've been working all day on trying to get the correct grid functionality on some cards I'm creating (see links to screenshots below). After working a while, I was able to get my desired results in Firefox, but when I test in Chrome... It's not anywhere close to the same as Firefox.
Firefox Results
Chrome Results
It seems when I comment out "height: 100%;" on the image the functionality is better in Chrome, but still not what I'm wanting.
Chrome with "height: 100%;" removed:
Here's my markup:
.projects {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(35rem, 1fr));
grid-gap: 7rem;
&__item {
display: grid;
grid-template-columns: repeat(2, 1fr);
grid-template-rows: repeat(2, 1fr);
}
&__img {
width: 100%;
height: 100%;
grid-column: 1 / -1;
grid-row: 1 / 2;
display: block;
object-position: center;
object-fit: cover;
}
}
<section class="projects">
<div class="projects__item projects__item--1">
<img src="img/projects-1.png" class="projects__img">
<div class="projects__content">
<h3 class="projects__heading--3 heading-3">Project Title</h3>
<p class="projects__text">
Insert Text
</p>
</div>
</div>
</section>
Can anyone see where I've gone wrong?