I have been using the code snippet below to make my landscape (4:3) photos fit into a carousel. However, I am now looking to dynamically change the width and height of the .carousel based on whether the photo is landscape or portrait orientation. How can I achieve this?
html {
height: 100%;
width: 100%;
}
body {
height: 100%;
width: 100%;
display: block;
}
.carousel {
/* The percentages specified here are for a 4:3 landscape photo (1600x1200) */
height: 60%;
width: 70%;
}
/* For portrait photos, I need to set height: 70%; and width: 60% */
Should I consider adding a class to the carousel-item indicating whether it's a landscape or portrait photo?