ios - iOS 中绝对定位的 Logo 未居中

标签 ios css-position

我 friend 网站上的 Logo 在所有浏览器中都能正常工作,但当我打开我的 iPhone 或 iPad(实际设备)时,一切都不稳定。

<a href="http://www.averylawoffice.ca/averywordpress"><img class="averylogo" src="<?php bloginfo('template_directory') ?>/img/HEADER-AveryLawOffice-LOGO.png" alt="Avery Law Office"></a>

它没有放置在任何包含的 div 中。就靠它自己了。

CSS

 .averylogo { position: absolute; width:360px; left: 50%; margin-left: -180px; z-index: 2; }

我不太清楚为什么它在其他地方都可以工作,但在我的 iPad 或 iPhone 上却无法正常工作。

这就是它的样子,但仅限于 iOS。 enter image description here

我做错了什么?

最佳答案

提供#main-navigation position:relative;,否则 Logo 将相对于正文定位,而正文会在较小的设备上调整大小。

Chris Coyier 有一个 article about it .

关于ios - iOS 中绝对定位的 Logo 未居中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10987491/

相关文章:

ios - -[UIScrollView zoomToRect :animated:] weird behavior when contentSize < bounds. 大小

html - 如何在 ionic 中创建这种类型的 View ?

iOS 8 : how to set height programmatically for a UITableview in a freeform ViewController

ios - instruments + 来自 shell 脚本的 UIAutomation

iOS:我可以从一个 block 中执行一个方法吗?或者这是不正确的?

javascript - 登录网页 -> <div> 并比较用户输入

css - 绝对定位的链接在点击时移动到意外位置(a :active)

jquery - 将固定的 div 定位在另一个 div 下以进行滚动

html - 为什么 translateX 对于 IE9、IE10 和 IE11 上的固定元素不能按预期工作?

ios - 每次用户点击图像时,在可缩放的 UIImageView 上绘制一个小方 block 。并缩放正方形