Skip to content

Commit 52e0acf

Browse files
author
Daniel Precioso, PhD
committed
Refactor featured image styles in custom CSS for consistent height and aspect ratio
1 parent 0a91c58 commit 52e0acf

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

assets/css/custom.css

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -61,18 +61,18 @@ align-items: center; /* Center items vertically within each post */
6161
overflow: hidden; /* Hide any content or image overflow */
6262
}
6363

64-
/* Ensure consistent height for featured images */
64+
/* Ensure consistent height for featured images */
6565
.archive__item-featured-image img {
66-
width: auto; /* The width will adjust depending on the height and aspect ratio of the image */
67-
min-height: 300px;
68-
margin-top: 10px; /* Adjust the top margin as needed */
69-
margin-bottom: 10px; /* Adjust the bottom margin as needed */
70-
object-fit: cover; /* Scale the image to cover its container without distorting its aspect ratio */
71-
object-position: center; /* Position the center of the image in the center of the container. Adjust if necessary. */
72-
border-radius: 5%; /* Add rounded corners to the featured image */
73-
display: flex; /* Remove extra space below the image */
74-
align-items: center; /* Center items vertically within each post */
75-
overflow: hidden;
66+
width: 100%;
67+
aspect-ratio: 4 / 3; /* Maintains consistent proportions */
68+
margin-top: 10px; /* Adjust the top margin as needed */
69+
margin-bottom: 10px; /* Adjust the bottom margin as needed */
70+
object-fit: cover; /* Scale the image to cover its container without distorting its aspect ratio */
71+
object-position: center; /* Position the center of the image in the center of the container. Adjust if necessary. */
72+
border-radius: 5%; /* Add rounded corners to the featured image */
73+
display: block;
74+
align-items: center; /* Center items vertically within each post */
75+
overflow: hidden;
7676
}
7777

7878
/* Ensure content takes up remaining space in the post */

0 commit comments

Comments
 (0)