Programming Examples
Create a web page which divides the page in two equal frames and place the audio and video clips.
Create a web page which divides the page in two equal frames and place the audio and video clips.
Solution<!DOCTYPE html>
<html>
<head>
<title>Audio and Video Frame Page</title>
<style>
body {
margin: 0;
height: 100vh;
display: flex;
}
.frame {
width: 50%;
padding: 20px;
box-sizing: border-box;
}
.left {
background-color: #f2f2f2;
}
.right {
background-color: #e6e6e6;
}
video, audio {
width: 100%;
margin-top: 20px;
}
</style>
</head>
<body>
<div class="frame left">
<h2>Audio Player</h2>
<audio controls>
<source src="audio.mp3" type="audio/mpeg">
Your browser does not support the audio element.
</audio>
</div>
<div class="frame right">
<h2>Video Player</h2>
<video controls>
<source src="video.mp4" type="video/mp4">
Your browser does not support the video element.
</video>
</div>
</body>
</html>
▶ RUN Output/ Explanation: