html - 单击 IOS 设备后按钮图标消失

标签 html css

我已经为文本创建了一个带有 span 的按钮,并且我已经添加了 background-image 到 span。在 Ios 设备中,当我点击按钮时,背景图像消失。

.button {
    width: 210px;
    height: 34px;
    border-radius: 20px;
    background-color: #B5D676;
    border: 1px solid #587F54;
    color: #325c46;
    outline: none;
    cursor: pointer;
}

.button span {
    font-size: 1em;
    font-family: ptsans-bold, sans-serif;
    padding-left: 40px;
    display: inline-block;
    height: 25px;
    background-position: left center;
    background-repeat: no-repeat;
}

.button span.link {
    background-image: url(../images/icon-link.png);
}

<button type="submit" value="Continue" class="button">
   <span class="link">
      @SharedLocalizer["ContinueText"]
   </span>
</button>

为什么会这样?

最佳答案

我创建了一个代码笔,但它仍然有效

我补充说 background-size: 100% 查看所有图片

参见代码笔 https://codepen.io/anon/pen/xjVbqQ

关于html - 单击 IOS 设备后按钮图标消失,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49994559/

相关文章:

html - 我如何垂直居中 ul 中的 li 元素? CSS

html - 复选框组可以识别重复区域结果吗?

css - 如何在 Markdown 中引用代码?

jquery - jquery 拖动停止后 chrome 中的表格边框问题

javascript - 获取 map 区域的位置(html)?

css - Flexbox 布局上从绝对元素到固定元素

html - 删除不需要的水平滚动(水平滚动来自哪里?)

css - 列宽去除填充

html - CSS3 目标 Div 覆盖 Webkit 过渡

html - 图片未垂直居中