userpic size

Apr 29, 2011 11:51

EDIT: solved!

I'm using a layout that resizes userpics (on the recent entries and friendspage view) from 100x100 to 75x75 and it works fine for square userpics but stretches out non square userpics to the incorrect ratios. So I was wondering if there was a way to resize userpics to max of 75x75 without screwing up the aspect ratio?

here are my codes: )

userpic

Leave a comment

nomoreprinces April 29 2011, 17:04:30 UTC
Decide which is more important to you, width or height and the delete the other dimension. When the image gets resized, the browser will resize to the desired height or width and keep the aspect ratio intact.

Reply

velshtein April 29 2011, 22:14:52 UTC
I deleted the height line (height:75px; from this section:

}
.entryUserinfo-usericon img {
border-top:10px solid black;
height:75px;
padding-top:5px;
width:75px;
}

And now the height of the userpics stay at their original heights while shrinking to the 75px width:

... )

Reply

nomoreprinces April 29 2011, 22:24:07 UTC
weird that should have worked.

trying putting the height back in as:

max-height: 75px;

Reply

velshtein April 30 2011, 02:01:59 UTC
No, that just made things act the same way in the beginning. Lmao I don't even have many non square icons but this is driving me a bit nuts. :D

Reply

nomoreprinces April 30 2011, 02:08:19 UTC
*sigh* I'm totally stumped :( I'd stay try min-height instead of max because I always get those two mixed up, but I suspect it'll just do the same thing as the first thing I had you try. :\

Reply

agneson9 April 30 2011, 09:24:25 UTC
try having the other dimension be 'auto' instead.

Reply

velshtein April 30 2011, 13:53:19 UTC
It worked! Thank you so much! :)

Reply

fiddlingfrog April 30 2011, 15:02:51 UTC
If you used width: 75px and height: auto try using a userpic that's 74px wide by 100px high and see what happens.

Reply

nomoreprinces April 30 2011, 16:06:27 UTC
thats the one i was missing! gah its been so long since ive messed around with css

Reply


Leave a comment

Up