简体   繁体   中英

How can I make the default audioplayer background be transparent

I want to make the background for the audio player be transparent. With the thing I tried I can change the color to any color but it wasn't working when I put transparent.

 audio::-webkit-media-controls-play-button, audio::-webkit-media-controls-panel { background-color: transparent; }

Like @snow said, you can't make the background transparent but you could make its opacity 0
something like this:

audio{
  opacity: 0%;
}

is it possible to change just using CSS? the short answer is no, It's NOT possible. An audio player is an object created by the browser itself, that's why it looks different depending on the browser you use.

You can apply the same background color to the audio tag if your parent or body background is white you need to apply the same for audio

audio::-webkit-media-controls-play-button,
 audio::-webkit-media-controls-panel {
 background-color: #fff;
 color: #fff;
 
 }

在此处输入图像描述

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM