2

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

我需要的是 440 像素的宽度和 720 像素的高度。当我将 iframe 中的宽度和高度设置为 440 x 720 时,它实际上以 440 x 520 呈现。

有修复的计划吗?

4

2 回答 2

0

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

例如:

<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>
于 2013-01-22T12:34:23.350 回答
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>

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

于 2012-05-05T14:45:29.593 回答