html - iOS设备上的CSS填充/边距问题

标签 html ios css

当我在iphone(iphone 6,ios 8)中查看以下结果时,加载程序略微位于按钮上方,但是当我使用chrome移动模拟器检查时看不到该结果。我不知道该如何解决,您认为可能是什么原因造成的?

img.loader {
    text-align: center;
    width: 20px;
    margin: auto;
    display: block;
    position: absolute;
    right: 15px;
    top: 10px;
}
button {
    width: 100%;
    padding: 12px;
    background: #4aa3df;
    color: #fff;
    border: none;
    font-size: 14px;
    margin-bottom: 10px;
    cursor: pointer;
    box-sizing: border-box;
}
.submitBtnWrap {
    position: relative;
}
<br>
<br>
<div class="submitBtnWrap">
    <button id="login_submit" class="btn btn-lg btn-primary btn-block" type="submit">Sign in</button>
    <img src="http://i.imgur.com/ScvlxYo.gif" class="loader">
</div>

最佳答案

如果您像在Example中那样直接使用float怎么办:

img.loader {
  text-align: center;
  width: 20px;
  float:right;
  margin:0;
}
button {
  width: 100%;
  padding: 8px;
  line-height:20px;
  background: #4aa3df;
  color: #fff;
  border: none;
  font-size: 14px;
  vertical-align:middle;
  cursor: pointer;
  box-sizing: border-box;
}
.submitBtnWrap {
  position: relative;
}

关于html - iOS设备上的CSS填充/边距问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29982076/

相关文章:

android - AdMob Interstitial 停止工作

ios - swift #pragma 替换来删除生产和开发中的代码(即 #if TEST_CODE == 1)?

ios - 如何在ios中的UITableview中聚焦最后一个单元格

html - 使左右导航栏绝对化?

html - CSS 使 div 在顶部和底部 flex 但在左侧和右侧笔直

javascript - IE6/7 和类名 (JS/HTML)

javascript - 当输入在标签内时更新单选标签文本

html - 内联 block 和 float 宽度/包装表现不同?

javascript - IE 中的 CSS 3d 变换

css - 如何使电子邮件具有响应性?