Problem: I would like to use a custom field image as the background for each item in a loop, but for some reason the last loop image is applied to all loop items.
Solution: We do not recommend creating style tags in the Loop Output:
<style>...</style>
Since CSS is parsed all together and not iteratively, only the last style tag will be respected. All the others will be overridden. This is how CSS works, it is not a bug. Instead of creating style tags in the loop, consider adding overriding styles to an individual element in the loop:
<div style="background-image:url('[types field='athlete-background' size='full' url='true'][/types]')"> ... </div>
The inline style attributes will not be overridden by the final style attribute.
Everyone can read this forum, but only Toolset clients and people who registered for Types community support can post in it.
Sun | Mon | Tue | Wed | Thu | Fri | Sat |
---|---|---|---|---|---|---|
8:00 – 12:00 | 8:00 – 12:00 | 8:00 – 12:00 | 8:00 – 12:00 | 8:00 – 12:00 | - | - |
13:00 – 17:00 | 13:00 – 17:00 | 13:00 – 17:00 | 13:00 – 17:00 | 13:00 – 17:00 | - | - |
Supporter timezone: America/New_York (GMT-04:00)
This topic contains 4 replies, has 2 voices.
Last updated by 6 years, 8 months ago.
Assisted by: Christian Cox.
The forum ‘Types Community Support’ is closed to new topics and replies.