Responsive images srcset
-
Is delivering scaled images using srcset a good idea?
Thinking of delivering one image size to Mobile and another to Desktop. How can I do this for all browsers?
Thanks Mike
-
AFAIK since the way images are used online hasn't 'significantly' changed in decades (as Zohaib says) - there is no factual industry standard. But this technique seems like it could yield faster page-loading speeds for mobile, which we all know Google does stand behind. Google often come up with an error on Page Speed insights which says, you are serving massive resolution images with a tiny viewport. They actually can and do regard that as an error, so surely if Google documents that the technique is acceptable to them and we know it solves certain issues, it is at least 'worth a try' IMO
-
I've always used CSS to scale images between devices. Though this can increase the page loading times, so for better performance there are plugins available for CMSs to improve page rendering speeds,
-
Images are some of the most important pieces of information on the web, but over the web’s 25-year history, they haven’t been very adaptable at all. Everything about them has been stubbornly fixed: their size, format and crop, all set in stone by a single
src
. -
Thanks, yes I had read this article but can't find any websites using this technique. Has it been adopted as an industry standard, or is there another option?
-
Google doesn't seem to have a problem with this:
https://developers.google.com/web/fundamentals/design-and-ux/responsive/images
"TL;DR
- Use relative sizes for images to prevent them from accidentally overflowing the container.
- Use the
picture
element when you want to specify different images depending on device characteristics (a.k.a. art direction). - Use
srcset
and thex
descriptor in theimg
element to give hints to the browser about the best image to use when choosing from different densities. - If your page only has one or two images and these are not used elsewhere on your site, consider using inline images to reduce file requests.
-
Enhance
img
s withsrcset
for high DPI devicesThe
srcset
attribute enhances the behavior of theimg
element, making it easy to provide multiple image files for different device characteristics. Similar to theimage-set
CSS function native to CSS,srcset
allows the browser to choose the best image depending on the characteristics of the device, for example using a 2x image on a 2x display, and potentially in the future, a 1x image on a 2x device when on a limited bandwidth network."This part seemed most important to me:
"On browsers that don't support
srcset
, the browser simply uses the default image file specified by thesrc
_ attribute. This is why it is important to always include a 1x image that can be displayed on any device, regardless of capabilities._ "... so basically you define your srcset as per Google's documentation, but you must be sure to include a default fallback image that could work on all browsers and devices - that's what gets used if the browser is unable to interpret your srcset (or if your srcset doesn't include anything for the specified browser)
Got a burning SEO question?
Subscribe to Moz Pro to gain full access to Q&A, answer questions, and ask your own.
Browse Questions
Explore more categories
-
Moz Tools
Chat with the community about the Moz tools.
-
SEO Tactics
Discuss the SEO process with fellow marketers
-
Community
Discuss industry events, jobs, and news!
-
Digital Marketing
Chat about tactics outside of SEO
-
Research & Trends
Dive into research and trends in the search industry.
-
Support
Connect on product support and feature requests.
Related Questions
-
Multiple H1s and Header Tags in Hero/Banner Images
I work on education websites, and our sites are being flagged by SEO and accessibility checkers for having multiple H1s. The home pages have the site name as an h3 in the hero image, and an aspirational headline (think: Be Like Mike) as an H1. The sub-pages have two H1s: one on the site name in the banner image, and the other on the page title. Note that the site name is very keyword-rich. If we were to remove the H1 and H3 tags from the hero/banner images, would it do any SEO harm? At the same time, we’d rewrite the H1 on the home page to be more keyword-focused. Any other options? I also read that it’s OK to have multiple H1s as long as it’s clear which H1 belongs to the heading area and which one belongs to the body area of the page. Thanks in advance!
On-Page Optimization | | UWPCE0 -
Is using a H1 tag in a logo image bad for SEO?
We have brand logos on certain pages that have H1 tags in them - the H1 text being the brand's name, as this is what we'd want the title of the page to be. The logos are at the top of the page instead of a written title. But is this the best option for SEO? Do search engines value H1 tags in images as highly as a standard H1 tag?Would it be better for SEO to add an alt tag to the logo and add a separate H1 tag on the page that's also the name of the brand?
On-Page Optimization | | DVLighting0 -
Duplicate Content when Using "visibility classes" in responsive design layouts? - a SEO-Problem?
I have text in the right column of my responsive layout which will show up below the the principal content on small devices. To do this I use visibility classes for DIVs. So I have a DIV with with a unique style text that is visible only on large screen sizes. I copied the same text into another div which shows only up only on small devices while the other div will be hidden in this moment. Technically I have the same text twice on my page. So this might be duplicate content detected as SPAM? I'm concerned because hidden text on page via expand-collapsable textblocks will be read by bots and in my case they will detect it twice?Does anybody have experiences on this issue?bestHolger
On-Page Optimization | | inlinear0 -
Alt image tags not being read by on-page optimization tool
Can bots see the keyword among other words in aIt image tags? For example, if the keyword is upholstery leather and the image tag says "our upholstery leather collection" will the keyword be recognized? Another example is buy leather. I have a image tag on a slide that reads "free samples before you buy leather" but an on-page analysis in moz does not show an alt tag title for buy leather? Same problem with an moz on-page analysis of the term upholstery leather. Thanks! Hunter
On-Page Optimization | | leatherhidestore0 -
What are the best practices for google indexing ajax response urls?
We just did a build to our site and our server erros went up to over 9,500. After looking into it, it seems like google is crawling the ajax urls and coming back with the errors. Here is one example http://www.rockymountainatvmc.com/productDetail.do?navType=type&vehicleId=1423&webTypeId=68&navTitle=Drive&webCatId=9&prodFamilyId=29660 If you know of any good articles on this please send them my way.
On-Page Optimization | | DoRM0 -
Image ALT Attribute
Hi, Got a message from the On-Page Optimizer to update the ALT Attribute in an image. Does that mean just rename the image and re-upload it on to the site? Thanks!
On-Page Optimization | | OTSEO0 -
Image file name, is it important
If I use the same image all over my site, do I need to change the file name to avoid duplicate? Different alt text will be use on those images
On-Page Optimization | | BigBlaze2050 -
How would you optimize thousands of images?
The majority of our images are not optimized for search. Specifically, the alt text and image title are blank. The image filenames are also not using descriptive keywords. We publish content quite frequently and this issue will be addressed within the production work flow for all images moving forward. As for the images currently existing on our site, what are some ways to scale the optimization for thousands of images that need to be optimized for alt text, title and filename? We're thinking about mechanical turk, but the problem is that we are a business magazine and have a lot of head shots of entrepreneurs that the mainstream might not recognize. Any insights would be appreciated.
On-Page Optimization | | inc.com0