1

I am using below code to display the audio in the browser

<audio  controls="controls" id="audio" width="300" height="300" src="<?='audios/remix.mp3'?>" > </audio>

The height of the audio tag is not adjusting correctly, can anyone tell me how to increase the height of the audio tag.

4

4 回答 4

3

您可以使用style="height: 300px;",但是,在 Firefox 中,它只是呈现为控件上方的大空白区域。(但是,正如预期的那样,单击空间会播放音频。)

于 2013-10-11T10:00:46.150 回答
1

音频标签没有这样的属性。

于 2013-10-11T09:59:55.580 回答
-1

我认为没有标签高度。您可能需要仔细检查此快速 html5 音频参考:

https://bytutorial.com/tutorials/html5/html5-audio-control

于 2013-10-11T11:16:27.870 回答
-1

无法设置 HTML5 样式<audio>

但它有一些你可以运行函数的事件和一个源标签,其中包含你想要播放的歌曲的路径以及歌曲的类型。

<audio id="song" width="300" height="32" ontimeupdate="updateTime()"><source src="path/to/music.mp3" type="audio/mp3" /></audio>    
Your browser does not support the audio tag.

您可以使用 JavaScript + CSS 来解决问题。

这是有关如何设置 HTML 5 音频播放器样式的教程

于 2013-10-11T10:05:28.260 回答