Dang, Kevin. I have to say that whenever I'm struggling to understand a layout concept, you're videos are always so refreshing. You're a gifted teacher. Simple, to the point, and practical.
The video on srcset I wish I watched at least 2 years ago! As ever, really well explained and great demo. In some sense, I feel like the solution is over complicated at the CSS level but this was more than enough to help get my head around it. Thanks, Kevin!
Thank you. I was reading and practicing about this topic but still not understanding it clearly until I watched your video. Now I'm confident enough to apply it on my own project. I really appreciate your explanation, and look forward to seeing more of your videos.
Hey Kevin, this was sooooo helpful. I'm currently building an image-heavy website ... and I never fully took the time to understand all the parameters available in srcset ... this was an excellent workshop and just took half an hour. Thank you so much!
Also, when dev tools are open in Chrome, you can long click (click and hold) on the reload icon in the browser's toolbar and you get the option to 'empty cache and hard reload'.
At 9:56 you suggest to use the lowest quality image, but devs may bear in mind that this isn't always the best option. In many situations you might actually want to provide the best quality image at the sacrifice of bandwidth to the end user. The reason for this would be that just because the end-user is using an old browser, this doesn't necessarily mean they're on a poor connection. Granted, there may be a correlation, but this should be taken case-by-case.
There should be another option in polls " Doesn't matter". Because for me it doesn't matter Code pen or VS Code. I'm more interested in topic. Great tutorial BTW.
Every time I think I've learned what I need to know, I find something new, lol Been working on a site for just over a month now, and stumbled across this today. Thanks for this video Kevin!
Thank you once again for amazingly helpful information! I think this is a very important thing to know to allow your images to be responsive and flexible for various devices.
Thank you! I was struggling to understand why one and the same image is loaded no matter which screen size I set in Chrome Dev Tools responsive emulator, and your video was really helpful :)
Excellent and thorough explanation. Now that I'm working toward fully responsive sites, I'll be using srcset to serve different images for phone, tablet, and desktop (more or less.) I'd never heard of srcset before a week ago and as I'm refreshing my web knowhow this is high on my radar.
I love this video, got so much out of it, and would be thrilled to see you do an update on how CSS and HTML have evolved with regard to how we can best present images on the web since you made this video 6 years ago.
Notepad++ is cool too. That's how I learned Web Dev. Really helpful how it gives popups when typing to give examples of what you can use, especially on the CSS page. Still learning every day and that certainly helps. Just so many declarations to remember. Sadly, after all the learning on my own and taking an extra web dev class last semester, I'm still struggling to get hamburger buttons working. Ive been struggling with responsive design and adaptive content.
Takes a long time to start putting everything together, and making things responsive just adds a deeper layer on top of that. Just keep practicing and it starts to get easier :)
I had to learn on notepad++ and type everything out Before I could use an editor with all those bells and whistles. Then I realized a little to late, that ++ offered Bells and whistles too ! Lol .. I look back and see the importance of knowing how to make everything happen with no extensions or expansions or suggestions, etc ... I like notepad ++, I’m no hater by any means but VS has my heart.
This is a good coincidence. I just started the Udacity nano degree and this is in the first module and did not understand sizes. You explain it much better than they do.
I'm glad I could help out Andrew! I hope the rest of the course meets your expectations, I've heard good things about Udacity and have thought about doing a few of their courses in the past.
First,Thanks for the video. Secondly, I did not get good results: without the media query, my browser never changed img as I resized. Thirdly, with the media query in place, transitions occurred way earlier than expected. Finally, I ended up using the element for my project.
sorry to be so offtopic but does anyone know a way to log back into an instagram account? I somehow forgot the login password. I love any assistance you can offer me!
@Ameer Jack i really appreciate your reply. I got to the site through google and I'm trying it out now. Seems to take quite some time so I will get back to you later when my account password hopefully is recovered.
Great video! i loved the use of cats. not anymore in new videos =P thanks as always kevin! you make it so clear, today i saw 4 more videos about it, all of them bring some to the table but yours always is the most educative and descriptive. thanks again from 2024!
@kevin powell thanks for this! Did you ever do a part 2 for this? 28:00 I am looking to include something like this in the theme I'm building and not finding any solutions that I like so far!
At 16:35, you say something like "as my window size is bigger as this (pointing at 1500), it will use this image (pointing at img/cat-1500.jpg). This is incorrect, it will start using img/cat-1500.jpg when the window size is bigger as 1000px.
thanks, love this! trying to get into more detail of loading and optimisation and it's hard to find good content on fundamentals like this. fun seeing an old video compared to your new stuff too.
wow... This is the video that I didn't know I needed. I used media queries and, if I remember correctly, the visibility property to achieve that same effect. using srcset seems so much easier!
I think doing it with media queries and css visibility isn't really helping with lowering bandwith. You're still downloading all the image versions. With srcset you literally are downloading only the single best sized image depending on the browser width, resolution, etc.
Yup, as John mentioned, this will load in all the images. You'd be better off just loading in one big image in that case I believe. You'll probably really like the picture element once I get there next week :)
Great video, thank you for the info! I have one question regarding 2x-3x retina screens. If a mobile device has a 3x screen should it download the highest quality image? Aren't mobile devices the ones with the most questional connections and where you want to your website to run the smoothest? If a mobile device downloads all the highresolution images and slows the website down then whats the point? Fundamentally I guess my question is should you strictly adhear to the screens pixeldensity or is it acceptable to stray away from it and follow your own preference if you feel thats best? What is best practice here? (new to this :D )
Maybe it is a great solution. I didn't know about it. I am learning and on my blog, which I am making to learn while doing it, I have sometimes a post with a lot of pictures. Load time was crazy slow, but the column is not wide, so I wrote myself JavaScript code and server side code which is returning to the user the smallest possible picture depending on column width. Now I think I have to rewrite it using srcset + sizes :) Thanks!
Thank you soooo much for doing this awesome videos! I do lern more from you than from enywere else on the internet. Great quality, great mic, nice you. Greetings from Austria and Thanks alot! keep going!
Great video, I’m wondering what people’s thoughts are on automating sizing picture sizes? Ideally, I’d like to output sizes in webp for most viewports and jpegs for mobile since support still isn’t there.
Just a question. If in src you specificy the 500px, but than the browser understand that it's better the 1000px, how the loading process works? Is it first loaded the 500px and than substituted with the 1000px or it is directly loaded the 1000px?
19:15 I don't think the browser divides the served width by the actual width and then decide whether that's above the threshold, rather it would make more sense to multiply the actual width by the DPX and choose the next bigger image... Much easier on the CPU
I do not know if it is possible but it would good to set srcset to none as replacement of display:none whenever you do not want to show an image under a certain width. For example on mobile devices I tend to hide some images, but with display:none the image will be loaded anyway.. Do you have any suggestion? Thanks in advance and thanks for sharing all your knowledge to us
I have resisted using SRCSET for long time, partly due to limited browser support partly as it seemed strange mixing layout information into the html... After wrestling with complex CSS media queries in my recent project I've realised that it's the best, most elegant and easiest to implement solution for the photos and illustrations in the content (not for the layout backgrounds, textures, and UI that are parts of CSS). Have the feeling that it should be a separate, 3rd layer of abstraction, tho (beside HTML and CSS) do deal exclusively with the viewport/output.
What's your recommendation when using a grid of images that scales with the viewport? In that case, would I have to write countless media queries to pass the width of each image at any given screen size? Or is there a better way of doing this?
Pole?.. IDE/Text Editor over Code Pen any day... as a newbie just nice to see all the code, not just the CodePen content code (it that made sense?).. and then write it myself in the same editor as VSC and Atom seem to be everyone's flavour at the mo.. Just a lot easier for a newbie to feel out and understand.. Keep up the awesome work dude! : )
Great video! I've been trying to use this but haven't been able to get it to work right. After watching your video I know for certain that it isn't my code. I think there must be something wrong with my browser or my computer. I'm using the latest version of Chrome and it doesn't seem to be reading the viewport width correctly. I tried checking the disable cache option but it's still loading the wrong image sizes at the wrong viewport widths. Have you heard anything like this before? I've been getting around it by using and but I would rather use this method if I can get it to work right.
The viewport width? I don't see why it wouldn't calculate it correctly. Try a simple media query with a changing background color to test how it responds to that. If it's for your images, could it be you have a higher resolution screen?
@@KevinPowell Yes I believe I do have a high resolution screen. It's a 13'' 2015 Macbook Pro. Everything except the images seem to respond to the right breakpoints.
Excellent video! One thing about the beginning of your CSS pixel explanation: "...a pixel on one device is not equal to a pixel on another device. That's because we're using CSS pixels..." I might be misunderstanding what you're saying here, but if you're saying CSS pixels are different across devices, I don't believe that's the case. Hardware pixels are different sizes, but CSS pixels are about the same size across different devices.
this explains well what i had trouble with. thank! question though: for the media queries for the size property, can we somehow access srcset inside of css and implement the properties there? Or something similar?
Nicely explained Kevin as always. As you mentioned 500w, 1000w in srcset and in media query example you mentioned vw...so, 500vw and 500w are the same?
Yup, because it's based on the viewport, not the parent element, so it's not 100%, it's 100vw as default. This is all loading in *before* the CSS, so it doesn't know the size of the parent when the image loads, which means it can't base anything on that.
In chrome it does not eve work when I disable the cache and refresh. If you start with the browser window size small it will choose the smallest image and then scale up to the larger images as you increase the size of the browser. If you shrink the browser, the largest image will remain selected. It works fine on firefox though! It only works on chrome if I refresh the page, but I need it to work when I resize the page as well. Is it possible?
Once it's loaded in the bigger version, it has no reason to drop to smaller ones. I think you might be after using the picture element, which lets you bring in different images based on screen size. I cover that later in this series 👍
Hey, Kevin. Thanks for the tut, but I'm running into issues with multiple media queries in the sizes attribute. It only ever implements the first query and never the ones following it. I see other tuts and blogs that show it's possible, but I can't get it to work at all and I've been trying to figure out what I'm doing wrong for a couple of days. Think you could give some insight? Here's the img tag
Cool series, great explanation! How do you decrease the size of jpeg images without them losing picture clarity at a smaller size? I've tried using gulp-image-resize with image sharpening but I am sure there is a better solution.
Dang, Kevin.
I have to say that whenever I'm struggling to understand a layout concept, you're videos are always so refreshing. You're a gifted teacher. Simple, to the point, and practical.
The video on srcset I wish I watched at least 2 years ago! As ever, really well explained and great demo. In some sense, I feel like the solution is over complicated at the CSS level but this was more than enough to help get my head around it. Thanks, Kevin!
Thank you. I was reading and practicing about this topic but still not understanding it clearly until I watched your video. Now I'm confident enough to apply it on my own project. I really appreciate your explanation, and look forward to seeing more of your videos.
Hey Kevin, this was sooooo helpful. I'm currently building an image-heavy website ... and I never fully took the time to understand all the parameters available in srcset ... this was an excellent workshop and just took half an hour. Thank you so much!
Came back to this video for the second time a few years after the first time. Always great stuff :)
Nice! I've come back to it myself a couple of times to remember parts of it 😅
Super! I found that this tutorial is only one with an explanation of "CSS Pixels" among huge numbers of CSS tutorials!
It's something most people don't realize. I need to do a video only on that subject I think.
You're amazing. I just finished my website project last week by following your advice. I wish this video was out two weeks ago haha
Great job as usual, Kevin. The way you explain things is very clear which makes it easier to understand!
I was stuck for hours to figure out "clearing the cache " before I came 2 this video.
But I found it in your video. U saved the day. thanks a lot...
Also, when dev tools are open in Chrome, you can long click (click and hold) on the reload icon in the browser's toolbar and you get the option to 'empty cache and hard reload'.
What an explanatory video, loved the math formula tip you showed based on device widths. Thanks a lot for this amazing takeaway about srcset
At 9:56 you suggest to use the lowest quality image, but devs may bear in mind that this isn't always the best option. In many situations you might actually want to provide the best quality image at the sacrifice of bandwidth to the end user. The reason for this would be that just because the end-user is using an old browser, this doesn't necessarily mean they're on a poor connection. Granted, there may be a correlation, but this should be taken case-by-case.
There should be another option in polls " Doesn't matter". Because for me it doesn't matter Code pen or VS Code. I'm more interested in topic. Great tutorial BTW.
I thought about it, but I figured I'd force people to make a decision :P - Glad you enjoyed the video!
Every time I think I've learned what I need to know, I find something new, lol
Been working on a site for just over a month now, and stumbled across this today. Thanks for this video Kevin!
Thank you once again for amazingly helpful information! I think this is a very important thing to know to allow your images to be responsive and flexible for various devices.
Thank you! I was struggling to understand why one and the same image is loaded no matter which screen size I set in Chrome Dev Tools responsive emulator, and your video was really helpful :)
Awesome. You have no idea how badly I need this on a project right now. Thanks a million Kevin.
But how do you put those width into img srcset when imgae is being loaded from backend
Thank you so much for your help with images, Kevin! Your tutorials are always the best!
Thanks Kevin. You have produced some quality videos this last month or so. I really appreciate it.
Excellent and thorough explanation. Now that I'm working toward fully responsive sites, I'll be using srcset to serve different images for phone, tablet, and desktop (more or less.) I'd never heard of srcset before a week ago and as I'm refreshing my web knowhow this is high on my radar.
I love this video, got so much out of it, and would be thrilled to see you do an update on how CSS and HTML have evolved with regard to how we can best present images on the web since you made this video 6 years ago.
I see this source set in wordpress but I don't know the concept behind it. Today I understand it and use it for my HTML website
Thanx Kevin
Awesome and very well explained tutorial! Kevin, thank you so much! 💛
you always surprise me with your content. it's concise and informative. Great work.
Another very helpful video. These videos always help me to learn a new way to improve my website!
Notepad++ is cool too. That's how I learned Web Dev. Really helpful how it gives popups when typing to give examples of what you can use, especially on the CSS page. Still learning every day and that certainly helps. Just so many declarations to remember.
Sadly, after all the learning on my own and taking an extra web dev class last semester, I'm still struggling to get hamburger buttons working. Ive been struggling with responsive design and adaptive content.
Takes a long time to start putting everything together, and making things responsive just adds a deeper layer on top of that. Just keep practicing and it starts to get easier :)
I had to learn on notepad++ and type everything out Before I could use an editor with all those bells and whistles. Then I realized a little to late, that ++ offered Bells and whistles too ! Lol .. I look back and see the importance of knowing how to make everything happen with no extensions or expansions or suggestions, etc ... I like notepad ++, I’m no hater by any means but VS has my heart.
Thank you. Good explanation of srcset and what the browser is doing.
This is a good coincidence. I just started the Udacity nano degree and this is in the first module and did not understand sizes. You explain it much better than they do.
I'm glad I could help out Andrew! I hope the rest of the course meets your expectations, I've heard good things about Udacity and have thought about doing a few of their courses in the past.
Ty. This was confusing at first buy you made it pretty simple and easier to understand.
First,Thanks for the video. Secondly, I did not get good results: without the media query, my browser never changed img as I resized. Thirdly, with the media query in place, transitions occurred way earlier than expected. Finally, I ended up using the element for my project.
I have learned a lot of things from you , I really appreciate what you do for us bingers in stuff like this 🖤
sorry to be so offtopic but does anyone know a way to log back into an instagram account?
I somehow forgot the login password. I love any assistance you can offer me!
@Zane Kase instablaster =)
@Ameer Jack i really appreciate your reply. I got to the site through google and I'm trying it out now.
Seems to take quite some time so I will get back to you later when my account password hopefully is recovered.
@Ameer Jack it did the trick and I now got access to my account again. Im so happy!
Thanks so much you really help me out !
@Zane Kase Happy to help :)
I finally understood this concept of size!
YES!!! You came through on kitten, as promised. I now have no choice but to Patreon this channel.
Haha, I'll make sure to keep them up :)
Great video! i loved the use of cats. not anymore in new videos =P thanks as always kevin! you make it so clear, today i saw 4 more videos about it, all of them bring some to the table but yours always is the most educative and descriptive. thanks again from 2024!
@kevin powell thanks for this! Did you ever do a part 2 for this? 28:00 I am looking to include something like this in the theme I'm building and not finding any solutions that I like so far!
At 16:35, you say something like "as my window size is bigger as this (pointing at 1500), it will use this image (pointing at img/cat-1500.jpg). This is incorrect, it will start using img/cat-1500.jpg when the window size is bigger as 1000px.
so enjoyable when watching your every video! thoughtful and clear
Thanks Kevin! Very well explained. Great help for me.
thanks, love this!
trying to get into more detail of loading and optimisation and it's hard to find good content on fundamentals like this.
fun seeing an old video compared to your new stuff too.
wow... This is the video that I didn't know I needed. I used media queries and, if I remember correctly, the visibility property to achieve that same effect. using srcset seems so much easier!
I think doing it with media queries and css visibility isn't really helping with lowering bandwith. You're still downloading all the image versions. With srcset you literally are downloading only the single best sized image depending on the browser width, resolution, etc.
I agree. I'm going to have to use this going forward.
Yup, as John mentioned, this will load in all the images. You'd be better off just loading in one big image in that case I believe. You'll probably really like the picture element once I get there next week :)
Oh man, i loved the video! Thank you so much for making it. God bless you sir.
Great video, thank you for the info!
I have one question regarding 2x-3x retina screens. If a mobile device has a 3x screen should it download the highest quality image?
Aren't mobile devices the ones with the most questional connections and where you want to your website to run the smoothest?
If a mobile device downloads all the highresolution images and slows the website down then whats the point?
Fundamentally I guess my question is should you strictly adhear to the screens pixeldensity or is it acceptable to stray away from it and follow your own preference if you feel thats best?
What is best practice here?
(new to this :D )
This is very good and useful tutorial and it explains advanced techniques. Thank you Kevin keep on going.
Thanks Igor, glad you liked it :D
we don't need dislikes for this guy plz, this will be helpful Kev thank you, keep it up ♥
Haha, always gonna be haters, it's all good
Maybe it is a great solution. I didn't know about it. I am learning and on my blog, which I am making to learn while doing it, I have sometimes a post with a lot of pictures. Load time was crazy slow, but the column is not wide, so I wrote myself JavaScript code and server side code which is returning to the user the smallest possible picture depending on column width. Now I think I have to rewrite it using srcset + sizes :) Thanks!
Thank you soooo much for doing this awesome videos! I do lern more from you than from enywere else on the internet. Great quality, great mic, nice you. Greetings from Austria and Thanks alot! keep going!
Thanks so much for the kind words Julian, and I'm so glad that you like and learn from my videos :D
thanks a lot for the channel, awesome video, and i'm definitely going to use srcset for my personal page!
Thank you very much from a teacher in Barcelona, Catalunya
No problem at all :D
Great video, as usual. Seems like I did a free course on Udacity that dealt with this, but your explanation has helped it stick better for me. Thanks!
Glad I could help :)
Very clear explanation. Thank you man
Kevin lost weight since this.
Good job!
100000 times clap clap clap....you saved my tons of time, Thank you for everything :) :) :)
Great video, I’m wondering what people’s thoughts are on automating sizing picture sizes? Ideally, I’d like to output sizes in webp for most viewports and jpegs for mobile since support still isn’t there.
Does the algorithm also evaluate the network speed? So based on this it can choose if load an low quality image as compromise
Hi Kevin, thank you. This is really interesting, as always. How would i apply this when I am using an img as a background in css though?
What a fantastic tutorial! Like a missing manual!
Just a question. If in src you specificy the 500px, but than the browser understand that it's better the 1000px, how the loading process works? Is it first loaded the 500px and than substituted with the 1000px or it is directly loaded the 1000px?
Great video Kevin, really helpful info, thank you!
19:15 I don't think the browser divides the served width by the actual width and then decide whether that's above the threshold, rather it would make more sense to multiply the actual width by the DPX and choose the next bigger image... Much easier on the CPU
That makes sense. I'm not exactly sure how it works (as you can tell), but I'm glad it works in this case :)
@@KevinPowellthat was just my thought, I haven't researched anything... :D
I do not know if it is possible but it would good to set srcset to none as replacement of display:none whenever you do not want to show an image under a certain width. For example on mobile devices I tend to hide some images, but with display:none the image will be loaded anyway.. Do you have any suggestion? Thanks in advance and thanks for sharing all your knowledge to us
Great explanation! Thank you so much for spending your time. Nice guy! :)
Awesome, I believe that this are indeed needed. Thanks🙌🏼
Thank you, I have read loads of tutorials and they dont explain it as clearly as this. Just one question how do you do the same for background images?
I have resisted using SRCSET for long time, partly due to limited browser support partly as it seemed strange mixing layout information into the html... After wrestling with complex CSS media queries in my recent project I've realised that it's the best, most elegant and easiest to implement solution for the photos and illustrations in the content (not for the layout backgrounds, textures, and UI that are parts of CSS). Have the feeling that it should be a separate, 3rd layer of abstraction, tho (beside HTML and CSS) do deal exclusively with the viewport/output.
Hey Kevin, do you have any videos on how to use grunt to make images responsive?
It was really helpful to me and thanks a lot for this.
thank you so much for that video this really made it easy for me to use srcset attribute and understand it very well
What's your recommendation when using a grid of images that scales with the viewport? In that case, would I have to write countless media queries to pass the width of each image at any given screen size? Or is there a better way of doing this?
your every video is amazing keep it coming sir!!
Thanks Hashaam!
Nice but how to make this work with "width" and "height" img attrigutes while also not triggering errors in Lighthouse reports?
Nice to know about (scrset). VSCode explanation is good. Use VSCode in all your code examples. Good health.
Very good topic. Thank's for sharing. Like this better than Codepen
where do you get pictures with different widths
Pole?.. IDE/Text Editor over Code Pen any day... as a newbie just nice to see all the code, not just the CodePen content code (it that made sense?).. and then write it myself in the same editor as VSC and Atom seem to be everyone's flavour at the mo.. Just a lot easier for a newbie to feel out and understand.. Keep up the awesome work dude! : )
Thanks for the feedback!
Kevin, you are awesome! I love your videos!
Thanks Ethan :)
Im still confused. How was sizes attribute able to select which image to use in srcset?
Thanks for the tutorial. What about device pixel ratio. Is it possible to conbinate it with w property in the same line?
Great video! I've been trying to use this but haven't been able to get it to work right. After watching your video I know for certain that it isn't my code. I think there must be something wrong with my browser or my computer. I'm using the latest version of Chrome and it doesn't seem to be reading the viewport width correctly. I tried checking the disable cache option but it's still loading the wrong image sizes at the wrong viewport widths. Have you heard anything like this before? I've been getting around it by using and but I would rather use this method if I can get it to work right.
The viewport width? I don't see why it wouldn't calculate it correctly. Try a simple media query with a changing background color to test how it responds to that. If it's for your images, could it be you have a higher resolution screen?
@@KevinPowell Yes I believe I do have a high resolution screen. It's a 13'' 2015 Macbook Pro. Everything except the images seem to respond to the right breakpoints.
at 19:37 why does he do the math 500 / 360? where does that formula come from?
Awsome vide! How would i apply this when I am using an img as a background in css though?
Thanks, I feel like I'm ready to implement this on the real project :)
I'm a beginner. How can I rotate img when I extend the page size ?
Any good ways to automate such process today?
I plan on using this for product item photos on e-commerce sites.
Thank you very much. How can I structure the code when I want have webp and jpg in different sizes?
Excellent video! One thing about the beginning of your CSS pixel explanation: "...a pixel on one device is not equal to a pixel on another device. That's because we're using CSS pixels..." I might be misunderstanding what you're saying here, but if you're saying CSS pixels are different across devices, I don't believe that's the case. Hardware pixels are different sizes, but CSS pixels are about the same size across different devices.
Been awhile since I recorded this, but I think what I wanted to say was "that's why we use CSS pixels"...
@@KevinPowell Ah, gotcha. By the way, awesome series, you are one of my favorite front end content creators on RUclips!
this explains well what i had trouble with. thank! question though: for the media queries for the size property, can we somehow access srcset inside of css and implement the properties there? Or something similar?
Nicely explained Kevin as always. As you mentioned 500w, 1000w in srcset and in media query example you mentioned vw...so, 500vw and 500w are the same?
What happens when you create a wrapper around the img, make it 50% width and the img inside 100% width? Do you still need the sizes attribute?
Yup, because it's based on the viewport, not the parent element, so it's not 100%, it's 100vw as default. This is all loading in *before* the CSS, so it doesn't know the size of the parent when the image loads, which means it can't base anything on that.
The image width (500w) doesn't have to match your images actual width. you could just put your viewport target in there.
Thank you so much for this video! Helped me a lot!
Very well explained..Well done!
Any topic that touches accessibility, performance and it optimisation is very useful nowadays
I'll have some accessibility videos coming early in the new year 👍
@@KevinPowell I'll be waiting!
Thank you so much, extremely clear.
Perfectly explained!
In chrome it does not eve work when I disable the cache and refresh. If you start with the browser window size small it will choose the smallest image and then scale up to the larger images as you increase the size of the browser. If you shrink the browser, the largest image will remain selected. It works fine on firefox though! It only works on chrome if I refresh the page, but I need it to work when I resize the page as well. Is it possible?
Once it's loaded in the bigger version, it has no reason to drop to smaller ones.
I think you might be after using the picture element, which lets you bring in different images based on screen size. I cover that later in this series 👍
Nice video! Finally understand it
Hey, Kevin. Thanks for the tut, but I'm running into issues with multiple media queries in the sizes attribute. It only ever implements the first query and never the ones following it. I see other tuts and blogs that show it's possible, but I can't get it to work at all and I've been trying to figure out what I'm doing wrong for a couple of days. Think you could give some insight? Here's the img tag
Thank you! I finally understood this!
Cool series, great explanation! How do you decrease the size of jpeg images without them losing picture clarity at a smaller size? I've tried using gulp-image-resize with image sharpening but I am sure there is a better solution.
Have you tried doing it by making a copy and taking it to a picture editing software and playing around? Did you find the answer to this question yet?
I love you! In the ru community, little is said about it