课程: HTML Essential Training (2020)

今天就学习课程吧!

今天就开通帐号,24,600 门业界名师课程任您挑!

Audio

Audio

- Earlier, we talked about how to put an image on a webpage. Images aren't the only kind of media you can put on a site, audio and video files are supported by HTML as well. Let's first take a look at audio. We can use the audio element to put audio files on a webpage. The HTML is fairly simple and it can trigger the browser to create an entire audio play or interface for us. The structure of the audio element is similar to the image element with a few differences. Unlike image, the audio element has both an opening and a closing tag. It's more modern and having both an opening and closing tag gives it more power and flexibility. Now just like the image element, we use a source attribute to provide the URL to the file. In this case, an audio file. There's more than one audio file format we can use and I'll talk about which formats are best in a few minutes. For now let's just link to this MP3 file. So…

内容