首页 > 解决方案 > 在 iOS 上使用“top”属性定位相对元素失败

问题描述

top在 iOS 上对相对定位的元素使用CSS 属性会失败。我使用此属性来模拟按钮的按下。为什么会失败,如何在 iOS 上达到同样的效果?

密码笔

<button>
  button
</button>

...

button {
  position: relative;
  padding: 30px 80px;
}

button:active {
  top: 6px;
}

标签: cssiosgoogle-chromesafaricross-browser

解决方案


推荐阅读