Website left aligned on iPad

前端 未结 3 910
伪装坚强ぢ
伪装坚强ぢ 2021-01-03 06:02

I\'m having problems with margin: 0 auto with my iPad. The div aligns to the left, not the center like it does on my desktop.

You can view

相关标签:
3条回答
  • 2021-01-03 06:38

    If you mean the whole div (whole page):

    margin-left: auto; margin-right: auto;

    0 讨论(0)
  • 2021-01-03 06:40

    Might be a case of overflow happening because you don't set a viewport for mobile devices.

    Try adding:

    <meta name="viewport" content="width=device-width,
                               maximum-scale=1.0" />
    

    to your HTML head to be certain. Which should set the page width to the iPad's width and make sure no scaling is happening.

    0 讨论(0)
  • 2021-01-03 06:46

    Validator Results

    You've got 26 errors and 11 warnings on your website. I would bet money that the reason your website isn't aligning correctly is due to one of these things. Fix your errors and see if that fixes the problem, otherwise, readdress the situation.

    0 讨论(0)
提交回复
热议问题