Skip to content
Grav 2.1 is out: every page speaks Markdown. Read the announcement →

Responsive hi-dpi/retina images as background?

Started by Muut Archive 11 years ago · 0 replies · 439 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 2284 9 years ago
Archive · by Muut Archive, 9 years ago
2 1498 9 years ago
Archive · by Muut Archive, 9 years ago
2 4748 9 years ago
Archive · by Muut Archive, 9 years ago
1 3564 9 years ago
Archive · by Muut Archive, 9 years ago
3 1623 9 years ago