XF 2.3 Thread prefix image

ArtG

Active member
Hi,

Does anyone know how to add an image (gif) to a thread prefix? I see a resource on adding a Font Awesome icon but not a gif.

Thanks,
Art
 
Solution
This is what I'm using and it's working.

see it live here with your image https://otra.org.uk/community/forums/test-posts.49/

Screenshot 2025-04-15 at 18.07.03.webp





CSS:
.label.label--test
{background: url(https://scapecrunch.com/burr.webp) no-repeat left center;
    background-size:20px;
     background-position:2px;
    background-color:yellow;
    color:black;
    padding-left:28px
 
}



class for custom prefix = label label--test

Screenshot 2025-04-15 at 17.55.58.webp



.label.label--test
{background: url(https://scapecrunch.com/burr.webp) no-repeat left center;
background-size:20px;
background-position:2px;
background-color:yellow;
color:black;
padding-left:28px

}
If you don’t need the gif to animate, I would add as a background image, e.g. positioned to the left with padding on the left so any text is clear of the image.
 
CSS:
.prefix--nameprefixhere {
    color: #fff;
    background: url('https://your-image-url.com/prefix-bg.png') no-repeat center center;
    background-size: cover;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}
Adjust as needed.

Webp images can't be gif.
 
This is what I'm using and it's working.

see it live here with your image https://otra.org.uk/community/forums/test-posts.49/

Screenshot 2025-04-15 at 18.07.03.webp





CSS:
.label.label--test
{background: url(https://scapecrunch.com/burr.webp) no-repeat left center;
    background-size:20px;
     background-position:2px;
    background-color:yellow;
    color:black;
    padding-left:28px
 
}



class for custom prefix = label label--test

Screenshot 2025-04-15 at 17.55.58.webp



.label.label--test
{background: url(https://scapecrunch.com/burr.webp) no-repeat left center;
background-size:20px;
background-position:2px;
background-color:yellow;
color:black;
padding-left:28px

}
 
Last edited:
Solution
CSS:
    .prefix--burr {
        display: inline-block;
        line-height: 20px;
        font-size: 15px;
          &::before {
            content: url('https://scapecrunch.com/burr.gif');
              margin-right: 4px;
             vertical-align: middle;
             top: 1px;
             position: relative;
        }
    }
Sadly, no image showing... I'm stumped.
 
This is what I'm using and it's working.

see it live here with your image https://otra.org.uk/community/forums/test-posts.49/

View attachment 321515





CSS:
.label.label--test
{background: url(https://scapecrunch.com/burr.webp) no-repeat left center;
    background-size:20px;
     background-position:2px;
    background-color:yellow;
    color:black;
    padding-left:28px
 
}



class for custom prefix = label label--test

View attachment 321513



.label.label--test
{background: url(https://scapecrunch.com/burr.webp) no-repeat left center;
background-size:20px;
background-position:2px;
background-color:yellow;
color:black;
padding-left:28px

}
Bingo! We have a winner. Thank you so much!
 
Back
Top Bottom