Professional Documents
Culture Documents
Computer 7 2nd Term Session 5
Computer 7 2nd Term Session 5
Computer 7 2nd Term Session 5
This attribute is used to specify that the target URL is designed for special devices (like
iPhone) , speech or print media. This attribute can accept several values. Only used if
the href attribute is present.
Audio:
<audio src="jazz.ogg"></audio>
Several other attributes may accompany the src attribute on the <audio> element; the
most popular include autoplay, controls, loop, and preload.
By default, the <audio> element isn’t displayed on a page. If the autoplay Boolean
attribute is present on the <audio> element, nothing will appear on the page, but the
audio file will automatically play upon loading.
To display the <audio> element on a page, the controls Boolean attribute is necessary.
At the moment, different browsers support different audio file formats, the three most
popular of which are ogg, mp3, and wav.
To begin, we’ll remove the src attribute from the <audio> element. Instead, we’ll use
the <source> element, with an src attribute, nested inside the <audio> element to
define a new source.
Using an <source> element and src attribute for each file format, we can list one audio
file format after the other. We’ll use the type attribute to help the browser identify which
audio types are available quickly. When a browser recognizes an audio file format, it
will load that file and ignore all the others.
<audio controls>
<source src="jazz.ogg" type="audio/ogg">
<source src="jazz.mp3" type="audio/mpeg">
<source src="jazz.wav" type="audio/wav">
Please <a href="jazz.mp3" download>download</a> the audio file.
The easiest way to put PDF in an HTML document is using the <a> tag with its href attribute. You need to
add the URL or the reference link of your PDF file to the element.
Another way of adding a PDF file to your HTML document is using the <iframe> tag. It allows
setting your preferred width and height as well. To have the code, follow these simple steps:
To specify the web address of your PDF file, set the source. Both of the mentioned properties can
be specified by "px", "cm", "vh", or percentages.
<iframe src="URL"></iframe>
To define the size of the iframe, set the height and width attributes:
<iframe src="URL" height="200" width="300"></iframe>
<!DOCTYPE html>
<html>
<head>
<title>Title of the document</title>
</head>
<body>
<h1>PDF Example with iframe</h1>
<iframe
src="/uploads/media/default/0001/01/540cb75550adf33f281f29132dddd14fded
85bfc.pdf" width="100%" height="500px">
</iframe>
</body>
</html>