SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Member
    Join Date
    Apr 2012
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Style not being implemented on iphone

    I am working on a classic asp site. On the landing page I have a div containing the following code <% Main.EmailSignup(false)%>. This leads to a spot in the Main.asp file with some simple text followed by a form with a single input field. On this text I have included a font-size style in a <p> tag. The style works fine on all browsers except mobile. On the iphone the font size is rendered properly then pops to a larger size than it is set for completely altering the layout of my page. Any help would be greatly appreciated. Thanks.
    Paul

  2. #2
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,117
    Mentioned
    448 Post(s)
    Tagged
    8 Thread(s)
    It's annoying the way iPhone resizes text like that. There is a way of preventing it, by adding this to your CSS:

    Code:
    body {
        -webkit-text-size-adjust:none;
    }
    However, it does have some consequences, such as not allowing text to be resized by the user ... even on desktop Safari.

    There was a suggestion around here the other day to try -webkit-text-size-adjust: 100%; but I haven't tried it yet, so not sure if it works.
    Facebook | Google+ | Twitter | Web Design Tips | Free Contact Form

    Forum Usage: Tips on posting code samples, images and more

    Forrest Gump: "IE is like a box of chocolates: you never know what you're gonna get."

  3. #3
    SitePoint Member
    Join Date
    Apr 2012
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for the suggestion. I used that on my personal site and it worked great. For my companies site, all I needed to do was add some height to the div that contained the text and the problem went away.

  4. #4
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,117
    Mentioned
    448 Post(s)
    Tagged
    8 Thread(s)
    Cool. But just as an aside, it's rarely a good idea to set a height on an element with text in it. Some people (like me!) who enlarge their text will see a right old mess.

    It's best to let elements fine their own height, based on the content within them.
    Facebook | Google+ | Twitter | Web Design Tips | Free Contact Form

    Forum Usage: Tips on posting code samples, images and more

    Forrest Gump: "IE is like a box of chocolates: you never know what you're gonna get."


Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •