当我在Chrome dev工具中将屏幕尺寸设置为较小时,或者当我在手机上查看我的项目时,当我点击按钮时,按钮周围会暂时出现一个蓝色方块.我曾try 将outline: noneoutline: 0设置为buttonbutton:hoverbutton:focusbutton:active以防止出现这种情况,但没有明显的变化.我判断了Chrome dev工具中的样式,但我不知道这个蓝色方块是从哪里来的,也不知道如何删除它或使其不可见.欢迎任何帮助.

这是我的HTML码:

<button>
    <span class="dice-wrapper">
        <img src="./src/assets/icon-dice.svg" alt="Dice icon">
    </span>
</button>

这是我的css:

button {
  width: 64px;
  aspect-ratio: 1 / 1;
  display: flex;
  justify-content: center;
  align-items: center;
  border: none;
  border-radius: 50%;
  background-color: var(--neon-green);
}

button:hover {
  cursor: pointer;
  box-shadow: 0 0 40px 3px var(--neon-green);
}

button:focus, button:active {
  box-shadow: none;
}

GitHub上的完整代码:https://github.com/Marjolein-Kasman-de-Jong/advice-generator-app

GitHub页面上的项目:https://marjolein-kasman-de-jong.github.io/advice-generator-app/

推荐答案

button {
  -webkit-tap-highlight-color: transparent;
}

Html相关问答推荐

Rmarkdown上的垂直标签集

如何将值从Google Sheets侧边栏中的表单中的输入传递到Google Sheets单元格中使用Textile()

仅包含名为X的子元素的元素的XPath?

Angular 滑块问题

如何在元素的三条边中间换行边框?

如何更改计时器S输入的Angular 字体大小?

获取标准的Python脚本,以便使用FASK对网站进行Flask

Vutify中看不见的V行

阴影部分内部的ionic Select 元素

如何在小屏幕中制作水平滚动div

当浏览器宽度减小时字体大小变得太大

jQuery 索引返回不正确的结果

如何从 div 内的图像中删除填充而不从其他所有内容中删除填充?

SVG 填充 colored颜色 不使用轮廓填充空白区域

如何调整底部有 SVG 的元素的高度,使其在所有宽度上看起来都不错?

如何使文本区域自动扩展到最大高度?

Cargo 在网格中的排列

无法从社交栏中 Select 选项

列宽等于最宽列宽度的无界容器

所有幻灯片上的 Quarto RevealJS 标题