Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

I have a issue whereby images that are I div because of the style percentage width property will get resize weirdly and will not display correcty in pc or mobile iPhone

What is the best way to position div for mobile purpose viewing

Percentage or there are other alternative?

Taking into consideration tat the image may be resize

share|improve this question

migrated from stackoverflow.com May 22 '11 at 12:18

This question came from our site for professional and enthusiast programmers.

3  
This entirely depends on what you are trying to display. Perhaps a different layout would be better. –  Brad May 22 '11 at 4:33
    
@ fndf : Hope this blog will help you mobile-web-html.blogspot.com –  sush May 22 '11 at 5:08

3 Answers 3

Generally speaking you will want to use relative widths (percentage or em based), because they scale far better than fixed width items.

Does the same thing occur when you view your website on a browser that has been sized very small? (Especially web-kit browsers)

As has already been mentioned, valid code is an excellent start to cross browser compatibility.

share|improve this answer

Percentages are probably the best way. I use the Foundation template which essentially allows nested grids. That is to say, a top level grid would be the maximum width and if you nest one in side four columns, twelve columns would be equivalent to the maximum width (the four columns).

EDIT: Please note that in this case, the maximum size is specified in pixels.

share|improve this answer

Try validating your site against an xhtml validator like the one at w3schools.com. If it passes the validator, there's a decent chance that it'll display pretty consistently in whichever browser you use.

w3schools Validators

share|improve this answer
9  
It's not any official guideline and you might consider it personal taste / opinion - but please do not recommend or link to w3schools. It's full of misinformation and does not deserve it's place in search engine results. See w3fools.com for reference. As for markup validation, use the official validator from the W3C instead, for instance. –  Johannes Pille May 22 '11 at 4:47

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.