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

  • 3
    This entirely depends on what you are trying to display. Perhaps a different layout would be better.
    – Brad
    May 22, 2011 at 4:33
  • @ fndf : Hope this blog will help you mobile-web-html.blogspot.com
    – sush
    May 22, 2011 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.


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.


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

  • 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, 2011 at 4:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.