ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Setting background image in html template

June 16, 2012 9:54pm

Subscribe [2]
  • #1 / Jun 16, 2012 9:54pm

    vacquah

    355 posts

    I am looking to set a background image property on an <a> element.

    Can’t set it in css because the image is pulled using something like this:

    {article_assets:url}

     

    Not sure how to specify this in the html template ( instead of css).  This works but i think there is a better way:

    a href="{comment_url_title_auto_path}" style="background-image: url({article_assets:url})"

    thx

  • #2 / Jul 10, 2012 9:42am

    Liam Crean

    121 posts

    The way you describe is best unless create your CSS as an EE template - then you can generate the BG image using the exp:channel:entries tag pair.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases