Spotify播放按钮的宽度和高度锁定为任意宽高比

时间:2012-04-12 05:44:49

标签: spotify

我注意到我无法为Spotify Play按钮选择任何我想要的宽度和高度组合。如果我使用生成器工具并增加宽度,它会自动增加高度字段以匹配任意宽高比。所以,我永远无法真正得到我需要的确切宽度和高度(即使在开发者页面上指定的最小值和最大值之内)。

我需要的是440px的宽度和720px的高度。当我将iframe中的宽度和高度设置为440 x 720时,实际上渲染为440 x 520。

有任何修复计划吗?

2 个答案:

答案 0 :(得分:0)

我有同样的问题来自定义spotify播放按钮。 我通过将自定义样式传递给iframe对象来解决问题:

style="width:480px; height:480px; margin-top:5px; margin-left:15px; margin-bottom:21px;"

例如:

<iframe src="https://embed.spotify.com/?uri=spotify:user:sharemyplaylists.com:playlist:0QoIyI6lLs5IfZMjOf5aNK&amp;theme=white" frameborder="0" allowtransparency="true" style="width:600px; height:680px; margin-top:5px; margin-left:15px; margin-bottom:21px;"></iframe>

我知道这种方式没有记录,但它对我有用。

答案 1 :(得分:0)

我不相信这实际上是一个错误;您可以 - 正如jackj4ck所说 - 将样式属性添加到嵌入代码中,或者只是更改嵌入代码为您提供的高度和宽度属性。

EG:

<iframe src="https://embed.spotify.com/?uri=spotify:track:4bz7uB4edifWKJXSDxwHcs" width="300" height="380" frameborder="0" allowtransparency="true"></iframe>

会变成:

<iframe src="https://embed.spotify.com/?uri=spotify:track:4bz7uB4edifWKJXSDxwHcs" width="440" height="720" frameborder="0" allowtransparency="true"></iframe>
相关问题