html 5 音频标签宽度 [英] html 5 audio tag width
问题描述
我想知道是否可以设置音频标签的宽度.默认情况下,它不是受支持的功能,因此会很乐意接受黑客".
我已经尝试将它们放在小 div 和表格中,但这看起来不太流畅......据我所知,我是唯一一个为此烦恼的人,但我真的很感谢一些帮助
I was wondering if it's possible to set the width of the audio tag. It is not a supported feature by default, so "hacks" will be happily accepted.
I already tried putting them in small div's and tables, but that doesn't look very smooth... As far as I can see, I'm the only one bothering about it, but I really appreciate some help
不需要跨平台/浏览器支持;只要 FireFox (3.6 ++) 支持,我就很高兴.
There is no need for cross-platform/browser support; I'm happy as long as FireFox (3.6 ++) supports it.
关于我将使用什么的快速示例:
Quick example as to what I'll be using:
<audio preload="auto" id="id12" controls="controls" onended="func12();" src="http://192.168.1.68/mymusic.wav"></audio>
推荐答案
使用 CSS 以与设置任何其他 HTML 元素的宽度相同的方式设置它:
Set it the same way you'd set the width of any other HTML element, with CSS:
audio { width: 200px; }
请注意,audio
在 Firefox 中默认为内联元素,因此您可能还想将其设置为 display:block
.这是一个例子.
Note that audio
is an inline element by default in Firefox, so you might also want to set it to display: block
. Here's an example.
这篇关于html 5 音频标签宽度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!