【问题标题】:HTML5 - Audio tag for some reason does not workHTML5 - 音频标签由于某种原因不起作用
【发布时间】:2015-01-16 17:29:49
【问题描述】:

我在学习教程时制作了一个 Html5 页面,出于某种原因,该标签适用于他,但不适用于我。 我在 Opera 和 Firefox 中尝试过,但两者都没有显示。只是一个带有我的标题的空白网页。

代码如下:

    <!DOCTYPE html>
<html>
    <head>
        <meta charset="utf8"/>
        <title>DogePage</title>
    </head>
    <body>
        <audio control >
            <source src="music1.mp3" type="audio/mpeg"/>
            If you can see this update your browser
        </audio>
    </body>
</html>

【问题讨论】:

  • 应该是&lt;audio controls&gt;
  • 谢谢大家 我刚刚标记了 Ozgur 酒吧的答案,因为他把它写成了最整洁的帖子。

标签: html audio tags


【解决方案1】:

它的控制不是控制 这是代码

<!DOCTYPE html>
<html>
<body>

<audio controls>
  <source src="abc.mp3" type="audio/mpeg">
Your browser does not support the audio element.
</audio>

</body>
</html>

【讨论】:

    【解决方案2】:
            Everything is good in your code just missing "s" in control it should be controls
    
    Like This:
    
     <!DOCTYPE html>
    <html>
        <head>
            <meta charset="utf8"/>
            <title>DogePage</title>
        </head>
        <body>
            <audio controls>
                <source src="music1.mp3" type="audio/mpeg"/>
                If you can see this update your browser
            </audio>
        </body>
    </html>
    

    【讨论】:

      【解决方案3】:

      您的标记无效。 &lt;audio&gt;标签没有control属性,应该是controls

      您需要像这样更改标记:

      <!DOCTYPE html>
      <html>
          <head>
              <meta charset="utf8"/>
              <title>DogePage</title>
          </head>
          <body>
              <audio controls> <!-- not *control* -->
                  <source src="music1.mp3" type="audio/mpeg"/>
                  If you can see this update your browser
              </audio>
          </body>
      </html>
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2012-01-28
        • 1970-01-01
        相关资源
        最近更新 更多