We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 9995
    • 1,613 Posts
    I’m struggling with styling some website also for ipad / iphone / and use portret or landscape.

    It doesn’t seem to be possible to style a page when using a ipad (768px) and give the holder/wrapper width 768px, then turn the ipad and give it different styling..
    When i use this here below i can give a styling when i turn the ipad, but then the width for iphone isn’t correct when i turn that.

    <meta name="viewport" content="width=768px, minimum-scale=1.0, maximum-scale=1.0" />
    <!-- iPhone 3 Stylesheet -->
    <link rel="stylesheet" media="only screen and (max-device-width: 480px)" href="/css/iphone.css" type="text/css" />
    <!-- iPad Stylesheet -->
    <link rel="stylesheet" media="all and (orientation:portrait)" href="/css/ipad768.css">
    


    So basicly asking, what is the best way to style my website for iphone / ipad and also be able to change styling when turning the ipad/iphone?

    #
    works on this website for iphone 3, can’t test ipad sad
    http://bransinanderson.com/
      Evolution user, I like the back-end speed and simplicity smiley
      • 36404
      • 307 Posts
      hi,

      you will probably have to do a bit more changes than just css (image size for example...) but i recently had to do that sort of thing and went for the php solution detecting ipod/ipad os and then putting the right css. this can be easily done with a simple snippet

      now, i wonder why you only care about iThings as there are many other mobile OS to deal with (in term of css the simplest way seem to use % instead of px for most your styles but that’s up to your taste), the really big difference between iCraps smiley and the others being the non flash support (i had to deal with this too and serve mp4 videos instead of a flash player with flashvars to see the right videos)

      have swing
        réfléchir avant d'agir
        • 5340
        • 1,624 Posts
        I’m currently building sites using http://stuffandnonsense.co.uk/projects/320andup/
        It takes longer to implement and you need to design your site accordingly.

        Cheers
          • 9995
          • 1,613 Posts
          Thanks for ur answers,

          @virtualgadjo
          Yea i can do some overflow hidden css for images or a #div img{size here}.
          Still don’t know how to use different css when use portret or landscape for ipad and iphone for example, i think it will pick the same css file. Need to test it.
          It’s not only iThings, but it are the most important ones for me.

          The problem with % is that the mockup / design is made 980px wide.

          @cipa
          Thanks for the link, I will be testing that.

          Maybe i need to use a min- and max-width for the turning of the ipad landscape/portret for example or it can be used when use 769px css file for landscape and 768px form portret?


          I will test. ->

          Cool, the fast mockup looks like it works, http://tinyurl.com/3j7u4ug
            Evolution user, I like the back-end speed and simplicity smiley
            • 9995
            • 1,613 Posts
            the cipa 320andup is what im gona try, looks like it works great, also for landscape, need to use the min- / max-width.
              Evolution user, I like the back-end speed and simplicity smiley
              • 3109 ☆ A M B ☆
              • 894 Posts
              You need to use CSS media queries and style your site from different resolutions, you can also try Lessframework which also uses a similar approach do a search for responsive web design you will find tons of tutorials out there.

              I highl recommend Ethan Marcottes Responsive Web Design book it is invaluable on how to create and understand how and why responsive web design is important.

              Good luck.
                Benjamin Marte
                Interactive Media Developer
                Follow Me on Twitter | Visit my site | Learn MODX