Skip to content

Commit 14c0863

Browse files
committed
force aspect ratio on non square images
1 parent 9cde741 commit 14c0863

2 files changed

Lines changed: 6 additions & 8 deletions

File tree

assets/sass/pages/_home.scss

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@
99
margin-bottom: 20px;
1010

1111
.text {
12+
aspect-ratio: 1/1;
1213
background-color: #fff;
13-
border-radius: 50px;
14+
border-radius: 25px;
1415
padding: 40px;
1516

1617
.title {
@@ -33,15 +34,12 @@
3334
}
3435

3536
.image {
36-
display: flex;
37-
justify-content: center;
38-
align-items: center;
39-
overflow: hidden;
40-
4137
img {
38+
aspect-ratio: 1/1;
39+
object-fit: cover;
4240
width: 100%;
4341
height: auto;
44-
border-radius: 50px;
42+
border-radius: 25px;
4543
}
4644
}
4745
}

index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
<a href="https://learn.adafruit.com/welcome-to-circuitpython">Get Started</a>
1818
</div>
1919
</div>
20-
<div class="image img-responsive-4by3">
20+
<div class="image">
2121
<img class="image-headline" alt=""
2222
src="{{ "assets/images/learn/sketch_drawing_toy.jpg" |
2323
relative_url }}"

0 commit comments

Comments
 (0)