Custom User Bar Mobile Alignment

JustBrowsing90

Newcomer

Status

offline

Posts

20

Likes

13

Bits Credits

0

LEVEL

1

200 XP

Forgive my ignorance as I'm still new to XenForo & this site so hopefully this is the right section.

I'm on v2.2.15 & would like to use custom images for the user bars. I've gotten them to align on profiles & the postbit but on mobile they're off to the side instead of being underneath like the one's were temporarily using via the [XTR] Unlimited User Group Banners 1.0.4 add-on.

So I'm wondering if there's a way to have them so they're aligned properly on mobile too & if it's one code for all user bars or if I'll need separate codes for every user bar based on the user bars size.

Also I don't own a mobile device so I'm simulating it via Chrome if that matters.

Here's a few screenshots of what I'm talking about along with the code I'm using in the extra.less template:

Profiles:

Postbit:

Custom user bars Mobile:


How I want them to be:

extra.less:
Code:
.userBanner-JIMZOF {
background: url("https://i.ibb.co/bBc5X7X/JIMZO-F-RANK.png") no-repeat;
height: 46px;
width: 106px;     
text-indent: -999999px;
margin: 0 auto;
}

Many thanks in advance :)
 

FateKid

DEVIL DID IT

Admin

Status

offline

Posts

14,962

Likes

130,816

Resources

3,400

Bits Credits

503

LEVEL

11

5,910 XP

Forgive my ignorance as I'm still new to XenForo & this site so hopefully this is the right section.

I'm on v2.2.15 & would like to use custom images for the user bars. I've gotten them to align on profiles & the postbit but on mobile they're off to the side instead of being underneath like the one's were temporarily using via the [XTR] Unlimited User Group Banners 1.0.4 add-on.

So I'm wondering if there's a way to have them so they're aligned properly on mobile too & if it's one code for all user bars or if I'll need separate codes for every user bar based on the user bars size.

Also I don't own a mobile device so I'm simulating it via Chrome if that matters.

Here's a few screenshots of what I'm talking about along with the code I'm using in the extra.less template:

Profiles:

Postbit:

Custom user bars Mobile:


How I want them to be:

extra.less:
Code:
.userBanner-JIMZOF {
background: url("https://i.ibb.co/bBc5X7X/JIMZO-F-RANK.png") no-repeat;
height: 46px;
width: 106px;  
text-indent: -999999px;
margin: 0 auto;
}

Many thanks in advance :)

Depending on your current element structure, you could display the elements within a flex container, using flex-direction and media queries to display it differently.
Drop your website link and I'll be able to send more customized CSS for you to use.

For example, a possible solution would be:
CSS:
/* ################### ORIGINAL CODE (Compressed) ################### */
.userBanner-JIMZOF { background: url("https://i.ibb.co/bBc5X7X/JIMZO-F-RANK.png") no-repeat; height: 46px; width: 106px; text-indent: -999999px; margin: 0 auto; }
/* ####################################################################### */

/* HTML Syntax - Mobile Queries */
@media only screen and (max-width: 600px)
{
    .userBanner-JIMZOF
    {
        display: flex !important;
        align-items: center !important;
        flex-direction: column !important;
    }
}
/* XenForo Template Syntax - Mobile Queries */
@media (max-width: @xf-responsiveNarrow)
{
    .userBanner-JIMZOF
    {
        display: flex !important;
        align-items: center !important;
        flex-direction: column !important;
    }
}

Again, this would work if you've contained both/all elements within a container, each element group being part of their own div.
 
Liked by:

JustBrowsing90

Newcomer

Status

offline

Posts

20

Likes

13

Bits Credits

0

LEVEL

1

200 XP

Depending on your current element structure, you could display the elements within a flex container, using flex-direction and media queries to display it differently.
Drop your website link and I'll be able to send more customized CSS for you to use.

For example, a possible solution would be:
CSS:
/* ################### ORIGINAL CODE (Compressed) ################### */
.userBanner-JIMZOF { background: url("https://i.ibb.co/bBc5X7X/JIMZO-F-RANK.png") no-repeat; height: 46px; width: 106px; text-indent: -999999px; margin: 0 auto; }
/* ####################################################################### */

/* HTML Syntax - Mobile Queries */
@media only screen and (max-width: 600px)
{
    .userBanner-JIMZOF
    {
        display: flex !important;
        align-items: center !important;
        flex-direction: column !important;
    }
}
/* XenForo Template Syntax - Mobile Queries */
@media (max-width: @xf-responsiveNarrow)
{
    .userBanner-JIMZOF
    {
        display: flex !important;
        align-items: center !important;
        flex-direction: column !important;
    }
}

Again, this would work if you've contained both/all elements within a container, each element group being part of their own div.
Worked perfectly. Many thanks :)
 

FateKid

DEVIL DID IT

Admin

Status

offline

Posts

14,962

Likes

130,816

Resources

3,400

Bits Credits

503

LEVEL

11

5,910 XP

Liked by:

Latest threads

Forum statistics

Threads
58,549
Messages
89,664
Members
55,449
Latest member
carti11
Top Bottom