Grokking HTML
0% completed
Embedding Audio in a Web Page
One line of markup puts a working audio player on a page. The pancake recipe page has a short recording in which the cook explains how to tell when a pancake is ready to flip:
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>Fluffy Pancakes</title> </head> <body> <h1>Fluffy Pancakes</h1> <h2>Listen: when to flip</h2> <audio src="audio/when-to-flip.mp3" controls></audio> </body> </html>
The <audio> element loads the sound file named in src, in the same way that `<img>
.....
.....
.....
Like the course? Get enrolled and start learning!
Reading Progress
0%