I have an image with relative width. Currently the src points to a single file, very large (let's say 1000px). My problem is that on small devices with Opera and IE the image, when scaled by the browser, looks terrible (you can see the pixels forming the image).
But if I provide a small image only, on HD displays it will look blurry.
Therefore I'd like to provide different image resolutions for each screen.
For what I've seen, there are few options currently suggested (question on SO), but none of the existing ones really suits my needs:
use
background
property (and then@media
for different screen resolutions):display: block; -moz-box-sizing: border-box; box-sizing: border-box; background: url(http://domain2.com/newbanner.png) no-repeat; width: 180px; /* Width of new image */ height: 236px; /* Height of new image */ padding-left: 180px; /* Equal to width of new image */
I don't like this solution since like relative width wouldn't work properly.
use
content: url()
. This solution only work with webkit browsersset multiple images and then use
display:none
. Bad for SEO
None of the above truly gives a cross-browser solutions that does what I'd like, any other idea?