CSS background image rendering differently on iPhone -


we have page design works great in every pc browser have tried, goes strange when viewed iphone or ipod touch.

the problem centred background image thats tall:

#content_container {  background-image:url('content-background.jpg'); background-position:top center; background-repeat:no-repeat; width:1020px; height:auto; } 

the content-background.jpg image tall (3000 pixels) , designed 'revealed' div in grows due content.

you'll have @ page , full css understand, i've stripped else out of design , re-produced problem example:

http://files.codeulike.com/static/cssexample/example.htm
(example made of 1 html file, 1 css file , 3 images)

you'll see in ie8, firefox, chrome you'll nice green box. in ios browser long thin background image gets re-scaled , goes odd.

(i'm using ipod touch 2nd gen assume same problem happen in other iphones/ipod touches).

any appreciated!

figured out: iphone has megapixel limit jpegs, after shrinks jpeg.

there's blog post on defusion.org.uk: http://www.defusion.org.uk/archives/2010/02/19/shrinking-large-background-image-bug-in-iphone-safari/

the limit after jpegs shrunk seems around 2 megapixels. documented ios resource limit , described here:

apple - creating compatible web content - know ios resource limits

the maximum decoded image size jpeg 32 megapixels using subsampling.

jpeg images can 32 megapixels due subsampling, allows jpeg images decode size has 1 sixteenth number of pixels. jpeg images larger 2 megapixels subsampled—that is, decoded reduced size. jpeg subsampling allows user view images latest digital cameras.

.. take mean jpegs under 2 megapixels displayed normally, jpegs between 2 , 32 megapixels displayed subsampling (shrinking), , jpegs on 32 megapixels presumably can't displayed @ all.

changing site use background image under 2 megapixels solved problem.


Comments

Popular posts from this blog

ASP.NET/SQL find the element ID and update database -

jquery - appear modal windows bottom -

c++ - Compiling static TagLib 1.6.3 libraries for Windows -