HTML embed tag usage and attributes detailed explanation

HTML embed tag usage and attributes detailed explanation

1. Basic grammar


Copy code
The code is as follows:

embed src=url

Note: embed can be used to insert various multimedia, the formats can be Midi, Wav, AIFF, AU, MP3, etc., Netscape and the new version of IE support it. url is the audio or video file and its path, which can be a relative path or an absolute path.

Example:

Copy code
The code is as follows:
<embed src="your.mid">

2. Attribute settings

1. Automatic playback:

Syntax: autostart=true, false
Description: This property specifies whether the audio or video file should be played automatically after downloading.
true: the music file will be played automatically after downloading;
false: The music file will not play automatically after downloading.
Example:

Copy code
The code is as follows:

<embed src="your.mid" autostart=true>
<embed src="your.mid" autostart=false>


2. Loop playback:

Syntax: loop=positive integer, true, false
Description: This property specifies whether an audio or video file should loop and how many times it should loop.
When the attribute value is a positive integer, the number of loops of the audio or video file is the same as the positive integer value;
When the property value is true, the audio or video file loops;
When the property value is false, the audio or video file does not loop.

Example:

Copy code
The code is as follows:
<embed src="your.mid" autostart=true loop=2>
<embed src="your.mid" autostart=true loop=true>
<embed src="your.mid" autostart=true loop=false>

3. Panel display:

Syntax: hidden=true,no
Description: This property specifies whether the control panel is displayed. The default value is no.
true: hide the panel;
no: Display the panel.

Example:

Copy code
The code is as follows:
<embed src="your.mid" hidden=true>
<embed src="your.mid" hidden=no>

4. Start time:

Syntax: starttime=mm:ss (minutes:seconds)
Description: This attribute specifies the time when the audio or video file starts playing. If undefined, play from the beginning of the file.
Example:

Copy code
The code is as follows:
<embed src="your.mid" starttime="00:10">

5. Volume:

Syntax: volume=an integer between 0 and 100. Description: This attribute specifies the volume of the audio or video file. If not defined, the system's own settings are used.
Example:

Copy code
The code is as follows:
<embed src="your.mid" volume="10">


6. Container properties:

Syntax: height=# width=#
Note: The value is a positive integer or percentage, in pixels. This property specifies the height and width of the control panel.
height: the height of the control panel;
width: The width of the control panel.
Example:

Copy code
The code is as follows:
<embed src="your.mid" height=200 width=200>

7. Container unit:

Syntax: units=pixels,en
Description: This property specifies the height and width in pixels or en.
Example:

Copy code
The code is as follows:
<embed src="your.mid" units="pixels" height=200 width=200>
<embed src="your.mid" units="en" height=200 width=200>


8. Appearance settings:

Syntax: controls=console, smallconsole, playbutton, pausebutton, stopbutton, volumelever Description: This property specifies the appearance of the control panel. The default value is console.
console: general normal panel;
smallconsole: a smaller panel;
playbutton: only display the play button;
pausebutton: only display the pause button;
stopbutton: only display the stop button;
volumelever: Only the volume adjustment button is displayed.

Example:

Copy code
The code is as follows:
<embed src="your.mid" controls=smallconsole>
<embed src="your.mid" controls=volumelvever>


9. Object name:

Syntax: name=#
Note: # is the name of the object. This property gives the object a name so that other objects can use it.
Example:

Copy code
The code is as follows:
<embed src="your.mid" name="video">

10. Description:

Syntax: title=#
Description: # is the text of the description. This attribute specifies the description text of an audio or video file.
Example:

Copy code
The code is as follows:
<embed src="your.mid" title="First Song">

11. Foreground and background colors:

Syntax: palette=color|color
Description: This property represents the foreground and background colors of the embedded audio or video file. The first value is the foreground color, and the second value is the background color, separated by |. color can be an RGB color (RRGGBB), a color name, or transparent.
Example:

Copy code
The code is as follows:
<embed src="your.mid" palette="red|black">


12. Alignment:

Syntax: align=top, bottom, center, baseline, left, right, texttop, middle, absmiddle, absbottom
Description: This property specifies the alignment of the control panel and objects in the current row.
center: The control panel is centered;
left: the control panel is on the left;
right: the control panel is on the right;
top: The top of the control panel is aligned with the top of the tallest object in the current row;
bottom: The bottom of the control panel is aligned with the baseline of the objects in the current row;
baseline: The bottom of the control panel is aligned with the baseline of the text;
texttop: The top of the control panel is aligned with the top of the tallest text in the current line;
middle: The middle of the control panel is aligned with the baseline of the current row;
absmiddle: The middle of the control panel is aligned with the middle of the current text or object;
absbottom: The bottom of the control panel is aligned with the bottom of the text.

Example:

Copy code
The code is as follows:
<embed src="your.mid" align=top>
<embed src="your.mid" align=center>

<<:  How to use CSS3 to implement a queue animation similar to online live broadcast

>>:  The role and methods of information communication in website visual design (picture and text)

Recommend

Tomcat common exceptions and solution code examples

The company project was developed in Java and the...

Understanding v-bind in vue

Table of contents 1. Analysis of key source code ...

Basic Implementation of AOP Programming in JavaScript

Introduction to AOP The main function of AOP (Asp...

HTML simple web form creation example introduction

<input> is used to collect user information ...

Vue implements local storage add, delete and modify functions

This article example shares the specific code of ...

Process analysis of deploying ASP.NET Core applications on Linux system Docker

Table of contents 1. System environment 2. Operat...

js to achieve cool fireworks effect

This article shares the specific code for using j...

Some wonderful uses of URL objects in JavaScript

Table of contents Preface Parsing parameters Modi...

Keepalived+Nginx+Tomcat sample code to implement high-availability Web cluster

Keepalived+Nginx+Tomcat to achieve high availabil...

Graphic tutorial on installing Ubuntu 18.04 on VMware 15 virtual machine

In the past few years, I have been moving back an...

Summary of commonly used commands for docker competition submission

Log in to your account export DOCKER_REGISTRY=reg...

Sample code for highlighting search keywords in WeChat mini program

1. Introduction When you encounter a requirement ...