Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

HTML HTML Video and Audio (Retired) Media Basics The Audio Element

Susan Harrison
Susan Harrison
4,849 Points

HTML Video & Audio: Challenge Task 3 of 4

Task: On the <audio> tag, add the proper type attribute that corresponds to the source file. Error: Oops! It looks like Task 2 is no longer passing.

What am I doing wrong? I followed the steps one-by-one.

index.html
<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>HTML Video and Audio</title>

    <link rel="stylesheet" href="normalize.css">
    <link href='http://fonts.googleapis.com/css?family=Nunito:400,300' rel='stylesheet' type='text/css'>
    <link rel="stylesheet" href="main.css">
  </head>
  <body>

    <h1>HTML Video and Audio</h1>

    <div class="wrapper">

      <!-- Add your code below this line -->

      <audio>
        <source src ="http://treehouse-code-samples.s3.amazonaws.com/html-video-and-audio/bridge-audio.mp3">
      </audio>

    </div>

  </body>
</html>

4 Answers

Use it to pass. <audio type="audio/mp3" src="http://treehouse-code-samples.s3.amazonaws.com/html-video-and-audio/bridge-audio.mp3"> </audio>

Susan Harrison
Susan Harrison
4,849 Points

Your answer is correct for Challenge Task 2 of 4, but I tried your code for Challenge Task 3 of 4 and it doesn't work.

<audio src="http://treehouse-code-samples.s3.amazonaws.com/html-video-and-audio/bridge-audio.mp3"> </audio>

I get the following error. On the <audio> tag, add the proper type attribute that corresponds to the source file. Bummer! Be sure to add a type attribute to your <audio> element.

Steve Fan
Steve Fan
8,218 Points

I have a same issue.

I have used <audio src="http://treehouse-code-samples.s3.amazonaws.com/html-video-and-audio/bridge-audio.mp3" tpye="video/mp3"> </audio>

However, It doesn't work.

Jason Anders
MOD
Jason Anders
Treehouse Moderator 145,858 Points

Hi Susan,

You're on the right track...

First, HTML doesn't have a <source> tag. What the challenge is asking for is that your src is attached to the <audio> tag. So, you just need to move the src line into the <audio> and delete the <source>.

Additionally, Although in most cases whitespace doesn't matter, it does when it comes to a space between the src and the = sign... so you'll need to also remove that space.

<audio src="http://treehouse-code-samples.s3.amazonaws.com/html-video-and-audio/bridge-audio.mp3">
</audio>

Keep Coding! :dizzy:

I hope this may help <source src="http://treehouse-code-samples.s3.amazonaws.com/html-video-and-audio/bridge.mp4" type="video/mp4">