2

So i have my handlebars template

<ul>
{{#each familia}}
    <li class="listItem">
        <div class="items" style="background-image:url(img/{{attributes.imagen}}">
            <div class="info">
                <h3>{{attributes.nombre}}</h3>
            </div>
        </div>
    </li>
{{/each}}
</ul>

when compiles it puts the url well, but the background-image not shows the image, plus in the chrome console it makes me a invalid property value... what am i doing wrong???

4

1 回答 1

1

您的 CSS 中有错字,url需要一个右括号:

background-image:url(img/{{attributes.imagen}})
// this was missing --------------------------^

否则该结构应该可以正常工作:http: //jsfiddle.net/ambiguous/zWp3d/

于 2013-10-29T06:02:10.393 回答