Slow day compared to yesterday.
Started off with a refresher of yesterday's topic then moved on to today's topic
Studied HTML Media
Images, Audio, Videos...
(WILL ATTACH PROJECT LATER AS IM HAVING GITHUB ISSUES)
*My notes: *
To embed an image in HTML, use the tag. This tag is self-closing and requires the src attribute to specify the image's path and the alt attribute to provide alternative text for accessibility.
Example:
<img src="path/to/image.jpg" alt="Description of image" width="600" height="400">
To embed audio, use the
Example:
<audio controls> <source src="path/to/audio.mp3" type="audio/mpeg"> <source src="path/to/audio.ogg" type="audio/ogg"> Your browser does not support the audio element. </audio>
To embed video, use the
<video width="600" height="400" controls> <source src="path/to/video.mp4" type="video/mp4"> <source src="path/to/video.ogg" type="video/ogg"> Your browser does not support the video tag. </video>
All together
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Media Embedding Example</title> </head> <body> <h1>Embedding Images, Audio, and Video in HTML</h1> <h2>Image Example</h2> <img src="path/to/image.jpg" alt="Beautiful Landscape" width="600" height="400"> <h2>Audio Example</h2> <audio controls> <source src="path/to/audio.mp3" type="audio/mpeg"> <source src="path/to/audio.ogg" type="audio/ogg"> Your browser does not support the audio element. </audio> <h2>Video Example</h2> <video width="600" height="400" controls> <source src="path/to/video.mp4" type="video/mp4"> <source src="path/to/video.ogg" type="video/ogg"> Your browser does not support the video tag. </video> </body> </html>
Done
The above is the detailed content of Day TML. For more information, please follow other related articles on the PHP Chinese website!