1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

XF 1.2 Use Xenforo helpers in CSS?

Discussion in 'Styling and Customization Questions' started by 017, Oct 27, 2013.

  1. 017

    017 Member

    I've been trying to parse users' avatars in CSS to use them in backgrounds instead of fitting them on member cards, but not having a whole lot of luck with it. It seems that even if I try using helpers inside style settings for <div> tags or whatnot it doesn't load. Is there a way for me to get an avatar's URL for background-image styling at all in xenforo?

    Some examples of what I'm doing:

    <a class="avatar NoOverlay Av{$user.user_id}l" href="{xen:link members, $user}" style="background-image: url("{xen:helper avatar, {$user}, l}"); background-position: center; background-size: cover;"></a>
    Basically I'm just attempting to fit the user avatar into the member card avatar cropper background instead of using an HTML IMG tag and mucking around with fitting that to it.
  2. Jeremy

    Jeremy XenForo Moderator Staff Member

Share This Page