Andrew
Andrew

Reputation: 1277

Why is my web page left-aligned on iPad?

I recently built a site and centered it using margin: 0 auto. I also wrapped elements in a .wrapper class with a width set to 960px and then had the parent element extend across the whole browser.

When I view the Brands screen on an iPad though, the site is left-aligned and does not extend across the whole window. Any thoughts to why this might be happening, and how to correct it?

See below for a screenshot:

Upvotes: 2

Views: 5788

Answers (2)

Rob Moen
Rob Moen

Reputation: 21

This works for a centered webpage with a width of 1024px:

<meta name="viewport"
      content="width=device-width, initial-scale=0.95, maximum-scale=0.95">

Upvotes: 2

Paul D. Waite
Paul D. Waite

Reputation: 98796

Looks like you’ve got a few validation errors on that page:

I suspect they might be causing the issue. If you look at the page in e.g. Chrome, you’ll see a horizontal scrollbar and space outside your wrapper <div> there, so the issues aren’t limited to the iPad.

Upvotes: 2

Related Questions