my concern is that I have to build a website for mobile devices. In the concept is an image set as header.
The problem is now: Different smartphones have different display resolutions.
There are e.g. 840×560, 480×320 or 800×480.
What do I have to write as meta-tags, css, etc. to fit the image in “every” modern smartphone to the display?
I hope my concern was clearly described.
Thanks, Chris
Because
width: 100%;seems to be well supported I’d suggest either:or
setting just the
widthmeans that the image’s width/height ratio will be preserved by the browser. Bear in mind, though, that passing off image manipulation (the scaling/resizing) to the phone’s browser might result in less-than pretty artefacts being introduced.If you have the option of using different sizes of images, you can call those using @media queries:
And, in those stylesheets, defining:
mobileStylesheet1.css
mobileStylesheet2.css
mobileStylesheet3.css