Web Site on iPhone Doesn't Take the Whole Screen

Posted on 2013-12-10
Last Modified: 2013-12-12
I am trying to create a web site using responsive design. I have a test page set up at When I go to it on my iPhone, it just shows the content in a very narrow column on the left side of the screen instead of using the full width of the screen. Could you let me know why this is?

Question by:webstuck5
  • 4
  • 2
LVL 53

Expert Comment

ID: 39708910
I don't know what you think responsive design is, but you do not have anything on that page to support any concept that could be called responsive.

So I think you need to start with an understanding of the terms:
Some of the link there will help a lot in undrstanding

Then you need exposure to the difference in mindset to do responsive design:

Then you need to understand the critical structure format built around media queries:

Or you can stumble around looking for plugins to implement "responsive design" ideas that someone else has and learn very little except how deal with the frustration of not being in control of your code.

As for iphone, it is always a problem, because Apple thinks they are too superior to follow standards, including not using the standard 96dpi for screens to map screens.


Author Comment

ID: 39710509
I did add some things to work towards it being responsive. I have also been reading a lot to learn more about it and asking questions on here to learn more. Maybe, if I could start with just getting the answer to my question of why the page only takes a small amount of the width of the iPhone would be helpful.

LVL 42

Accepted Solution

David S. earned 500 total points
ID: 39711799
It seems that the last ad on the page ("#ad_footer_1") has content with a fixed width of 970px. That makes the iPhone fit a page that wide into a screen much less wide then that, hence the effective font-size shrinks.

Putting ads in a responsive layout is a challenge. I'm not aware of any good solution to it. One quick and dirty fix would be to give "max-width:100%" and "overflow:hidden" to the ads.

Do you really think that <br> elements are the most appropriate markup for that page? That sure looks like unordered lists to me. Also why does the page have an <h2> and <h3>s but not an <h1>? If the font-size is too big, use CSS to change it.
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.


Author Comment

ID: 39713158
A lot of the HTML problems are because I stripped the page content out of my CMS system to just focus on making it work on mobile devices first. So, when the CMS header and footer code gets added, it will have an <h1> tag. Yeah, the content should probably be in a list format. I was just using an old page as my test page. Thanks for answering my question. That makes a lot of sense! Let me test out your code to make sure it works and then I will award you the points!

Author Comment

ID: 39713198
Out of said for a "quick a dirty fix" use "max-width:100%" and "overflow:hidden"  but what is the longer just use smaller ads? I tried a smaller ad there before but probably since the whole page was being shrunk by mobile safari, it didn't look right.
LVL 42

Expert Comment

by:David S.
ID: 39713252
The other solutions I've heard of are to use smaller ads or to use additional JavaScript code to select ads based on viewport size.

Author Closing Comment

ID: 39713443
Thanks so much!

Featured Post

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction If you're like most people, you have occasionally made a typographical error when you're entering information into an online form.  And to your consternation, the browser remembers the error, and offers to autocomplete your future entr…
In this article we will discuss all things related to StageFright bug, the most vulnerable bug of android devices.
In this tutorial viewers will learn how to position overlapping items using z-index in CSS. They will also learn the restrictions on the z-index property.  Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Red.…
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…

821 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question