XF 2.2 Avatar position on profile page

Hareon

Active member
I would like to adjust the avatar position on my forum. As I use Ozzmods Badges, the Badges must have raised the avatar's height a little.

I would like to leave it a little lower because there is a blank space there that I would like to fill with something.

Does anyone have any ideas on where I can fix this?

1716517066943.webp
 
Solution
Try changing the position with padding then
Code:
.memberHeader-avatar
{padding-top:30px}

And test on mobile

To not have the padding on smaller screens use this instead:

Code:
@media (min-width: @xf-responsiveNarrow)
{
.memberHeader-avatar
    {padding-top:30px}}
Hmmm it seems that profiles that don't have a photo in the avatar have the avatar a little too low from the ideal position.

View attachment 303067

So I actually had a similar issue- try:

Code:
.avatar.avatar--default.avatar {top: -5px}
(whatever px you used, this is just from what I'm using)

This code should target just the profiles that have an avatar as just text since it is the default avatar.

You should be able to target both (.memberHeader-avatar) without any issues. I just tested on my own website and it worked for me!
 
So I actually had a similar issue- try:

Code:
.avatar.avatar--default.avatar {top: -5px}
(whatever px you used, this is just from what I'm using)

This code should target just the profiles that have an avatar as just text since it is the default avatar.

You should be able to target both (.memberHeader-avatar) without any issues. I just tested on my own website and it worked for me!

Is not working. only the code with 50px is working.

1716608067550.webp1716608092355.webp
 
An alternative is

Code:
.avatarWrapper
{position:30px}

However if it is something is wrong due to a theme or addon you may get help from the developer
 
Last edited:
This code didn't work. Its effect was to reduce the size of the cover photo, but the position of the avatar remained above.

But I thought better and there are some things that are influencing. I'm not using any style. I use the Xenforo standard.

But I'm using a code to increase the banner size and also Ozzmods Badges. Badges are inserted in that darker part where the profile information is located.

Apparently the avatar photo is uneven because of Badges. Avatar seems to want to level out the size of this dark area that serves to improve reading. When we use the first code you provided, profiles that don't have a cover photo or badges end up suffering a greater impact from .memberHeader-avatar

With badges
1716627993870.webp

Without badges
1716628039628.webp
 
Try changing the position with padding then
Code:
.memberHeader-avatar
{padding-top:30px}

And test on mobile

To not have the padding on smaller screens use this instead:

Code:
@media (min-width: @xf-responsiveNarrow)
{
.memberHeader-avatar
    {padding-top:30px}}
 
Last edited:
Solution
Try changing the position with padding then
Code:
.memberHeader-avatar
{padding-top:30px}

And test on mobile
This code helps, but it still affects profiles that are OK, such as profiles without covers and without badges.

Well, anyway, I left a post here https://xenforo.com/community/threads/ozzmodz-badges.196529/page-43#post-1683055

to inform the author and see if there is any way to change the position badges and still make them prominent on the profile as it currently is, but without influencing the Avatar's position.

Thank you very much.
 
Did you test on mobiles?

Might be better on smaller screens with

Code:
@media (min-width: @xf-responsiveMedium)
{
.memberHeader-avatar
    {padding-top:30px}}

or

Code:
@media (min-width: @xf-responsiveNarrow)
{
.memberHeader-avatar
    {padding-top:30px}}
 
The code does not affect the mobile version. On mobile everything is OK.

1716650105005.webp

The problem was really on the PC. I tested both codes. Ideally, the avatar would take up more space at the bottom so as not to have that blank space. The problem is that this causes all avatars to move down, with avatars from new profiles already occupying that space.

Adjusting it to 50px looks good on profiles that need it (which have badges), but it is pressed against the tabs below.

If there was some kind of margin that prevented the avatar from touching the tabs below, I think there would be no problem.

In a test with 100px, it looks perfect on the avatar with badges, but it looks bad on profiles without a cover and without an avatar.

1716650603747.webp

1716650660616.webp
 
Back
Top Bottom