2012-11-23 231 views
7

如果html5中的音頻播放器使用音頻標籤生成,是否有任何更改尺寸的可能性。是否可以在html5中更改音頻播放器的尺寸

+0

是的,有_lots_的自定義音頻播放器的方法。 [你有什麼嘗試?](http://whathaveyoutried.com) –

+0

我想保持代碼簡單。我剛纔插入音頻標籤,我只是想增加播放器的寬度。我想避免使用任何庫。 – samdonly1

回答

15

<audio>可以作爲任何其他html元素的樣式。

要增加寬度,只需使用css屬性width

一些HTML代碼:

<audio id="player" controls autoplay> 
  <source src="http://xseignard.github.com/webGLWebAudioAPI/sound/OGLikeCapone.ogg" type="audio/ogg"> 
  Your browser does not support the audio tag. 
</audio>​​​ 

而CSS:

#player { 
 width: 100%; 
}​ 

問候