Effective Ways to Fix White Background Error in Spotify Embed Code
P粉665427988
2023-08-15 17:41:08
<p><br /></p>
<pre class="brush:php;toolbar:false;"><iframe src="https://open.spotify.com/embed/track/6wsqVwoiVH2kde4k4KKAFU?utm_source=generator" width="500" height= "100" allow="autoplay; clipboard-write; encrypted-media; fullscreen; picture-in-picture" loading="lazy"></iframe></pre>
<p>I'm using NextJS 13.4. No problem in light mode. But when I switch to dark mode, there is a white background behind the song, like this: </p>
<p>Background error in Spotify embed code</p>
<p>I can't resolve this error via CSS. Thank you in advance. </p>
<p>I want the song container to be transparent. </p>
You should not style the background, but should use one of the supported heights, and then the player will have its own color to embed.
In your case, do the following:
frameBorder="0"
to remove the surrounding white lines.style="border-radius:12px"
to remove the white corners.