4. Multimedia tags #
Created Tuesday 01 September 2020
Available multimedia types are:
- image
- video
- audio
- iframe
- PDF via browser level core plugins
Image #
- <img> - self closing image tag
- src - path to image file.
- alt - text for image file, displayed if image is unavailable
- width - in px
- height - in px
- title - tooltip upon hover
- <figure></figure> - used when image has a caption associated with it.
- <figcaption></figcaption> - to add caption to image. Used in conjunction only inside a
figure
tag - one inside one
Example - figure
tag is immensely helpful.
<figure>
<img src="myCat.jpg" />
<figcaption>My Cat</figcaption>
<figure></figure>
</figure>
Video #
- Syntax:
<video src="">Video not loaded text</video>
- Attributes:
src
height
width
poster
= “image.png”autoplay
control
loop
muted
Audio #
<audio controls>alt_text_here</audio>
<source src="" type="audio/mpeg" />
needs to be inside audio - can be used for sound awa transcripts
mAid - self closing tags don’t have a text content.
iframe #
- Used for getting a webview from a website.
- It is not a self closing tag
<iframe src="">Fallback text here</iframe>
src
width
allow="autoplay"
allowfullscreen
- Has limited scripting support for security
- Example code
<iframe src="https://www.youtube.com/embed/2DGxm1csQQM?" width="height" allow="autoplay" allowfullscreen ></iframe>
<iframe style="border-radius:12px" src="https://open.spotify.com/embed/track/6SFAshmB8xVQZMIPrJ1qqY?utm_source=generator" width="100%" height="152" frameborder="0" allowfullscreen="" allow="autoplay; clipboard-write; encrypted-media; fullscreen; picture-in-picture" loading="lazy" ></iframe>
-
Example outputs (below):
A note on path #
src
path follows UNIX notation.- Use forward slash, even if website is on a Windows machine.
- Relative paths are allowed -
.
and..
can be used, relative to the current page. - Absolute paths are OK too, from the root of the machine.
- Note: index.html does not determine the root in any case.