Welcome to the Treehouse Community
Looking to learn something new?
Jonathan GrieveTreehouse Moderator 90,705 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."