Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CSS applying Max-height and Auto height property at the same time for an image

Tags:

html

css

How do I set the the max-height:270px and height:auto simultaneously such that if a content(image) is too large it should shorten its dimensions and put it under 270px, else it should be an auto height.

I tried with overflow-Y but I dont want a scrollbar, just a mini version of the pic. How can I do that?

like image 357
PythonEnthusiast Avatar asked Sep 06 '13 08:09

PythonEnthusiast


1 Answers

CHANGED CODE :: TRY IT

img{
height:100%;
max-height:270px;
}
like image 191
Ritabrata Gautam Avatar answered Sep 28 '22 01:09

Ritabrata Gautam