Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.Start your free trial
Jonathan GrieveTreehouse Moderator 91,252 Points
Handling Pixel Density
Taking the SVG course earlier today reminded me of my Treehouse education earlier last year when I was taught about pixel density and how different screen resolutions affect Raster images.
Only I never really did much about it as it seemed too complicated at the time. Which means assets on my sites aren't really optimised for mobile beyond a bit of CSS width and height styling.
So I thought I'd ask again How do you handle images in different device pixel ratios. I think I remember something about a code snippet in which you swap images together but I can't remember how that's achieved. Maybe point me the way to the course that teaches it? :)
I think, you mean this - SVG Basics, see "SVG and CSS" in second section ?
"SVG is an XML based language, and they can be embedded directly into HTML. This means their presentation can be adjusted with CSS, which allows SVGs to respond appropriately to different screen sizes."