Reputation: 646
I use a class for my portrait and landscape images. All my landscape images have the same size of 1400x1000px (700x500px 5K retina proof). And i want the portrait images always to be 700px in height and width set to auto, but it doesn't seem to work that way. Why?
.size-m { /* project image portrait */
max-height: 700px;
width: auto;
}
.size-xl { /* project image landscape */
max-width: 700px;
height: auto;
}
Upvotes: 0
Views: 417
Reputation: 201
I might be misunderstanding, but this appears to be working fine in these jsfiddles:
img {
max-width: 700px;
height: auto;
}
img {
max-height: 700px;
width: auto;
}
Upvotes: 1