I'm trying to find a method to re-size image (.jpg) file base on the longest side. Images taken vertically and horizontally will have different longest side, I'm trying to fit them into a size-fixed div (inline-block). If I control only width or length, they will not be in scale (squashed).
I have read "CSS Equivalent of the “if” statement", it seems that there is a similar/possible method I can go about... finding which is the longest side (width OR height) and then adding 2 css for that.
Perhaps something along the lines below? (Page is HTML based)
CSS
img.thumb { identify longest side} //not quite sure how to go about this
img.thumb width {
width:200px;
height:auto;
border:0px;
}
img.thumb height{
width:auto;
height:200px;
border:0px;
}
I would prefer not to, but do I need to use JQuery instead (e.g. find image width and length, if width > length then add "width" to class)