Skip to content
Grav 2.0 is officially stable. Read the announcement →

Community guidelines

Please keep discussions civil and on-topic. Repeated violations may lead to a temporary ban.

Archive

Responsive hi-dpi/retina images as background?

Started by Muut Archive 11 years ago · 0 replies · 271 views
11 years ago

As much as I understand there is no such functionality in grav yet.
If I do it like this, and provide a [email protected], always the "1x" version is used

---html
<div class="hero-image" style="background-image:url( {{ page.media['hero.jpg'].url }} )"></div>

TXT


I'm not a CSS expert but it looks like image-set is the equivalent to srcset for background images. Unfortunately image-set is not well supported by browsers at this time. 

Any ideas or plans to achieve this? Thx
👍 1

Suggested topics

Topic Participants Replies Views Activity
Archive · by Deleted User, 9 years ago
0 1277 9 years ago
Archive · by Muut Archive, 9 years ago
2 885 9 years ago
Archive · by Muut Archive, 9 years ago
2 4014 9 years ago
Archive · by Muut Archive, 9 years ago
1 2890 9 years ago
Archive · by Muut Archive, 9 years ago
3 1074 9 years ago