Skip to content

Commit 8f3fedc

Browse files
committed
Card: Prevent image streching
1 parent 0fb89c0 commit 8f3fedc

File tree

3 files changed

+11
-3
lines changed

3 files changed

+11
-3
lines changed

_includes/card.html

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
<section id="card">
1+
<section>
22
<h2>{{include.title}}</h2>
3-
<div class="card rounded shadow" style="height: 400px;">
3+
<div class="card rounded shadow">
44
<img srcset="{{include.image375}} 375w,
55
{{include.image690}} 690w,
6-
{{include.image1110}} 1110w" sizes="100vw" class="card-img" style="height: 400px; object-fit:cover; " alt="{{include.imagealt}}">
6+
{{include.image1110}} 1110w" sizes="100vw" class="card-img" alt="{{include.imagealt}}">
77
<div class="card-img-overlay d-flex flex-column">
88
<h1 class="text-white pl-3">{{include.overlayheadline}}</h1>
99
<p class="text.white pl-3">{{ include.text }}</p>

_sass/_card.scss

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
.card {
2+
height: 400px;
3+
img {
4+
object-fit: cover;
5+
height: 400px;
6+
}
7+
}

css/main.scss

+1
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,4 @@ $fa-font-path: "../font-awesome/fonts";
1515
@import "button";
1616
@import "header";
1717
@import "section";
18+
@import "card";

0 commit comments

Comments
 (0)