Simple Machines Community Forum

Customizing SMF => SMF Coding Discussion => Topic started by: eskie on October 01, 2020, 03:01:43 PM

Title: resizing avatar next to greeting
Post by: eskie on October 01, 2020, 03:01:43 PM
back w/ another dumb question :^)

how do you resize the avatar that displays next to your greeting in the top left corner? i've set max dimensions in the avatar settings in admin, but i'd like that to apply to the poster info next to your posts, rather than the avatar next to the greeting, as i like that one fitting the box evenly.

i've tried adding:
.avatar > img {max-width: whatever you like; max-height: whatever;}
at the end of index.css, and it's worked before, but not now. any ideas? :0
Title: Re: resizing avatar next to greeting
Post by: Antechinus on October 01, 2020, 03:34:43 PM
Should work. Unless the admin settings are overriding it. Is this 2.0.x or 2.1 you're talking about?
Title: Re: resizing avatar next to greeting
Post by: eskie on October 01, 2020, 04:13:58 PM
2.0.17! hmm, should i delete the settings in admin then?
Title: Re: resizing avatar next to greeting
Post by: Antechinus on October 01, 2020, 04:41:50 PM
I usually just handle all avatar sizing in the CSS. Less stuff to worry about that way.
Title: Re: resizing avatar next to greeting
Post by: eskie on October 01, 2020, 04:59:32 PM
okay, so i've deleted the max/min settings in the admin section, and added this to the end of my index.css:
{
.avatar > img {max-width: 90px; max-height: 90px;}
.poster > ul > li > fieldset > a > img {
max-width:35px;
max-height:35px;
width: 35px;
height: 35px;
}

and it's still not working. now i just have giant avatars on my forum lmao
Title: Re: resizing avatar next to greeting
Post by: Antechinus on October 01, 2020, 06:35:45 PM
fieldset? Which theme are you using? That's not standard 2.0.x markup.

You should be able to nail the ones next to posts with this:

.poster img.avatar {width: auto; height: auto; max-width: **px; max-height: **px;}

And the ones up top with this:

.user img.avatar {width: auto; height: auto; max-width: **px; max-height: **px;}

If that's still not working (in case there's some inline widths and heights declared somewhere) this should do it:

img.avatar{width: auto!important; height: auto!important;}
.user img.avatar {max-width: **px; max-height: **px;}
.poster img.avatar {max-width: **px; max-height: **px;}


Where obviously you just drop in whatever max-width and max-height you want.
Title: Re: resizing avatar next to greeting
Post by: eskie on October 01, 2020, 07:48:26 PM
perfect- this worked great! thank you so much!