2

I am trying to specify a background image using an attribute from my element; like so:

.gallery-tile {
    background-image: attr(data-thumbnail url, '');
}

Though no images are loading, is someone able to explain why this does not working? I followed the specification's as laid out here.

Nimeshka Srimal
  • 8,012
  • 5
  • 42
  • 57
CS Dude
  • 421
  • 4
  • 14

1 Answers1

1

Note: The attr() function can be used with any CSS property, but support for properties other than content is experimental.

https://developer.mozilla.org/en-US/docs/Web/CSS/attr

It's an experimental feature and the only supported attribute is content.

Nimeshka Srimal
  • 8,012
  • 5
  • 42
  • 57