3 ms·
Isn't this something solved by CSS media selectors? Choose the images via CSS ("background" images, appropriately sized) within media selector criteria such as
by huggyface 15y ago
Isn't this something solved by CSS media selectors? Choose the images via CSS ("background" images, appropriately sized) within media selector criteria such as resolution and density.
As an aside I despise any separation that even brings up the word mobile. My smartphone has a higher resolution than many desktops...coupled with a higher network performance than many high speed connections. The days of treating these mobile computers as gimpy halfwits is long past.
- tommi 15y agoHow would you use CSS media selectors with dynamic content?
- evanm 15y agothe CSS could be created on the fly, outside of a unified stylesheet.
- pault 15y agoWith background images you lose the ability to scale an image to fit its container, which is one of the key components of a truly adaptive (fluid) layout. However, if you are using a fixed grid that merely resizes at certain thresholds in viewport width (like bootstrap's adaptive grids), that will work fine. Regarding mobile, I'm not sure the separation is about performance as much as it is about being nice to users with capped data plans. And even with a high resolution mobile display, you just don't need the same size images for a 3 inch phone as you do for a 24 inch desktop monitor. In fact, I think one of the intentions of the responsive design movement is to serve identical experiences to desktops and mobiles, while adjusting the format somewhat to make the latter easier on the eyes. This is a huge improvement over serving one of those dumbed-down, text only mobile sites that blogs and such are so fond of redirecting you to (I'm looking at you, wordpress).
- underwater 15y agoCSS property background-size (https://developer.mozilla.org/en/CSS/background-size https://developer.mozilla.org/en/CSS/background-size) has contain and cover properties, which will scale the image to fit its container.
- pault 15y agoYes, I'm looking forward to dropping IE8 support so I can use this. :)