javascript - 删除具有重叠 png 按钮图像的按钮残留物
问题描述
我有两个箭头,它们都是按钮和重叠滚动条的 png 图像。除了这两个在我设置箭头样式时似乎不会移动/消失的小方块之外,箭头还可以工作。它们似乎是箭头留下的空按钮。我需要小方块消失,并尝试了边框:无和背景颜色:透明,但这些和其他 css 命令似乎只适用于箭头,而不适用于底部的小框。帮助!
按钮 html 和 css:
<button onclick="scrollMe('left')"> <img id="arrowL" src='../static/imj/arrowLeft.png' > </button>
<button onclick="scrollMe('right')"> <img id="arrowR" src='../static/imj/arrowRight.png'> </button>
#arrowL{
width: 7%;
position: absolute;
left: 9px;
top: 812px;
z-index: 3;
}
#arrowR{
width: 7%;
position: absolute;
left: 657px;
top: 812px;
z-index: 3;
}'
解决方案
您的 CSS 样式仅适用于这些img
元素ids
上的元素
要设置按钮的样式,您可以使用类似的类.arrow-button
,例如
<button onclick="scrollMe('left')" class="arrow-button"> <img id="arrowL" src='../static/imj/arrowLeft.png' > </button>
<button onclick="scrollMe('right')" class="arrow-button"> <img id="arrowR" src='../static/imj/arrowRight.png'> </button>
//CSS
.arrow-button {
background-color:transparent;
border:none;
}
推荐阅读
- terraform - 在模块内的模块之间传递 Terraform 变量?
- visual-studio - Azure DevOps 服务器 - CI - 数据库单元测试
- java - 用 latlong 坐标将 WFS 绘制到 Java 中的画布上
- bash - 如何使用 find 命令递归打印带有标题的文本
- xml - 重写多个文件并避免错误 XTRE1500:无法读取在同一转换期间写入的文档
- python - 默认单选按钮在第二个 tkinter 窗口中不起作用
- hibernate - 在 SpringBoot 中加入返回 null 但 MySQL 返回 4 行
- javascript - 在Javascript中用随机元音替换每个元音,用随机辅音替换每个辅音
- php - 如何获取选择 vuejs 的 id 和 v-text
- c++ - 有没有使用 c++ 编写的 GTK+3 中不使用 css 的多行文本字段的示例?