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

Comments 12

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


fiddlingfrog April 30 2011, 04:16:52 UTC
Use
width: 75%;
height: 75%

This will keep the userpics at a maximum 75px by 75px but keep the ratio intact.

Reply

velshtein April 30 2011, 04:34:06 UTC
This is what I changed:

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

And it squashing the icons a lot:

... )

Reply

fiddlingfrog April 30 2011, 14:17:16 UTC
Sorry. You need a semi-colon after height: 75%; in order for it to work.

Reply


Leave a comment

Up