css - 有没有办法让自定义 CSS 按钮在背景中透明?
问题描述
我正在尝试使用 css 制作自定义播放按钮。我到了我有这个的地步:
.play{
height: 74px;
border-width: 37px 0px 37px 67px;
padding-right: 0;
border-color: transparent transparent transparent #33ffff;
margin-top:25px;
margin-left:25px;
margin-bottom:25px;
}
#body{
background-color:red;
}
<div id="body">
<button class="play" id="playB"></button>
</div>
我只是想知道当border-color: transparent transparent transparent #33ffff;
背后有背景时是否有任何方法可以使实际透明?我不想看到灰色。
解决方案
当然,灰色是背景。也将其设置为透明。
.play{
height: 74px;
border-width: 37px 0px 37px 67px;
padding-right: 0;
border-color: transparent transparent transparent #33ffff;
margin-top:25px;
margin-left:25px;
margin-bottom:25px;
background: transparent
}
#body{
background-color:red;
}
<div id="body">
<button class="play" id="playB"></button>
</div>
推荐阅读
- laravel - 在 Laravel 验证请求中,如何在更新时处理不同列的唯一性
- python - 计算两个 txt.files 之间的相似度
- java - 如何在 Spring Boot 中实现单线程调度程序?
- python - 向旧的 csv 文件添加新行
- c++ - 为什么我的函数无法使用指针打印多维数组的元素?
- java - Spring Boot 延迟 Flyway 初始化循环依赖
- python-3.x - Tkinter - 带有标签的窗口空白,但可以打印标签中的相同值
- javascript - 如何在没有用户主动登录的情况下从 Outlook 插件任务窗格获取联系人?
- java - Spring servlet 适用于 IntelliJ,但不适用于 tomcat
- azure - Azure 流分析查询将日期时间字段转换为单独的日期和时间字段