Your Web News in One Place

Help Webnuz

Referal links:

Sign up for GreenGeeks web hosting
May 31, 2019 02:54 pm GMT

Reducing motion with the picture element

Heres a bonafide CSS/HTML trick from Brad Frost and Dave Rupert where they use the <picture> element to switch out a GIF file with an image if the user has reduced motion enabled. This is how Brad goes about implementing that:

<picture>  <!-- This image will be loaded if the media query is true  -->  <source srcset="no-motion.jpg" media="(prefers-reduced-motion: reduce)"></source>  <!--  Otherwise, load this gif -->  <img srcset="animated.gif alt="brick wall"/></picture>

How nifty is this? It makes me wonder if … Read article

The post Reducing motion with the picture element appeared first on CSS-Tricks.


Original Link: http://bradfrost.com/blog/post/reducing-motion-with-the-picture-element/

Share this article:    Share on Facebook
View Full Article

CSS Tricks

A Web Design Community curated by Chris Coyier

More About this Source Visit CSS Tricks