KandZ – Tuts

We like to help…!

HTML 24 💻 embed and object elements

External resources

<embed src="https://www.youtube.com/watch?v=GqlHhUm5vnc" width="640" height="360" title="Linux CLI" type="video/mp4">

embed element embeds an external resource, video/audio file
it does not work with youtube
it also embeds local video and audio files
src attribute specifies the URL of the resource
width and height attributes specify width and height
title attribute describes the content
type attribute specifies the type of the resource
No support for fallback content

<object type="video/mp4" data="https://www.youtube.com/watch?v=GqlHhUm5vnc" width="450" height="300">
  Not supported. Direct link a href="https://www.youtube.com/watch?v=GqlHhUm5vnc">Here</a>
</object>

object element embeds an external resource like embed element
It also supports PDF, image files even an HTML document
type specifies the resource type
data specifies the URL of the resource
width and height specify the width and the height
inner HTML is the fallback content in case object element is not supported
other attributes: name and form

Leave a Reply