Page 87 - Computer - 8
P. 87

2.  Save  the  first  file  as  ‘Parts  of  Computer  2.html’  and  the
                second file as ‘Keyboard2.html’.
            3.  Open the ‘Parts of Computer 2.html’ file in Microsoft Edge.
                 The document is displayed as shown in the image.






                                                      4.  Click the picture of the keyboard.

                                                          The document ‘Keyboard2.html’ opens in the same tab.





          INSERTING AUDIO

          You can add audio files to a web page to add background music or provide a song or spoken-word
          performance that visitors can play. HTML5 provides the <audio> tag to add audio file to a web page.

          Audio <audio> Tag
          The <audio> tag is an empty tag. The various attributes of the <audio> tag are given in the table.

           Attribute                                      Description                                      Value(s)
           src         Specifies the URL of the audio file.                                               URL

           height      Plays the audio file automatically as the web page loads in the web browser.       autoplay

           controls    Displays controls in the web page to control the audio playback.                   controls

           loop        Replays the audio file once it has finished playing.                               loop


            Lab Activity 6

           To insert an audio file on a web page.                                                  Experiential Learning
            1.  Open Notepad and create the HTML document as shown below.

                 <!DOCTYPE html>                                      2.  Open the HTML document in Microsoft
                 <html>                                                   Edge.
                 <head> <title> Audio in HTML </title> </head>
                 <style type=“text/css”>
                 h1 {color: Blue; text-align: center; font-size: 40px}
                 p {color: Green; text-align: left; font-size: 30px}
                 </style>
                 <body>
                 <h1> Importance of Music  </h1>
                 <p> <b> Music is elixir for life. It uplifts the mood
                 and gives you positive energy. It soothes the soul and
                 has the power to alter emotions. </b> </p>
                 <p> <b> Here’s some relaxing music for you. </b> </p>
                 <audio src=“Music File 1.mp3” autoplay= “autoplay”
                 controls = “controls”>
                 </body>
                 </html>


                                                                                                              85
   82   83   84   85   86   87   88   89   90   91   92