Skip to content

Commit 765b034

Browse files
authored
Merge pull request #7495 from saurabhraghuvanshii/blog-images
fix image align issues at /blog pages
2 parents 5a50f74 + 7fe09be commit 765b034

File tree

1 file changed

+19
-6
lines changed

1 file changed

+19
-6
lines changed

src/components/Card/Card.style.js

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -60,16 +60,29 @@ export const CardWrapper = styled.div`
6060
6161
.gatsby-image-wrapper,
6262
.old-gatsby-image-wrapper {
63+
width: 100%;
6364
height: 100%;
64-
margin-top: 0.2rem;
65+
margin-top: 0;
6566
transition: all 0.3s ease-in;
67+
display: flex;
68+
align-items: center;
69+
justify-content: center;
6670
}
67-
img {
68-
height: inherit;
69-
max-height: 180px;
71+
72+
.gatsby-image-wrapper img,
73+
.old-gatsby-image-wrapper img {
74+
max-width: 100%;
75+
max-height: 100%;
76+
width: auto;
77+
height: auto;
7078
display: block;
71-
text-align: center;
72-
margin: auto;
79+
object-fit: contain;
80+
object-position: center;
81+
margin: 0 auto;
82+
}
83+
84+
@media screen and (max-width: 768px) {
85+
height: 9.5rem;
7386
}
7487
}
7588

0 commit comments

Comments
 (0)