How much do you know about the use of html5<embed> tags? The following article will give you a main explanation of the 7 ways to use the html5<embed> tag and the attribute usage of the html5<embed> tag.
Definition and usage of html5<embed> tags:
<embed> tags define embedded content, such as plugins. Below are examples:
<embed src= "helloworld.swf"/>
Properties of the html5<embed> tag:
HTML5 embed tags using methods and properties in detail:
Basic syntax
The code is as follows:
Embed Src=url
Description: Embed can be used to insert a variety of multimedia, format can be Midi, Wav, AIFF, AU, MP3 and so on, Netscape and the new version of IE are supported. The URL is an audio or video file and its path, which can be a relative path or an absolute path.
example, the code is as follows:
<embed src= "Your.mid" >
1.<embed> Label Container properties:
Syntax: height=# width=#
Note: The value is a positive integer or a percentage, in pixels. This property specifies the height and width of the control panel.
Height: level of Control Panel;
Width: The height of the control Panel.
example, the code is as follows:
<embed src= "Your.mid" height=200 width=200>
2.<embed> label foreground and background colors:
Syntax: Palette=color|color
Description: This property represents the foreground and background color of an embedded audio or video file, the first value is a front color, the second value is the background color, and the middle is used | Separated. The color can be an RGB color (RRGGBB) or a color name, or it can be transparent (transparent).
example, the code is as follows:
<embed src= "Your.mid" palette= "Red|black" >
3.<embed> Label Alignment:
Syntax: align=top, bottom, center, baseline, left, right, Texttop, middle, absmiddle, absbottom
Description: This property specifies the alignment of the control Panel and the objects in the current row.
Center: Control Panel Center;
Left: The control Panel is right;
Right: The control Panel is on the left;
Top: The topmost part of the control Panel is aligned with the top of the highest object in the current line;
Bottom: The bottom of the control Panel aligns with the baseline of the object in the current line;
Baseline: The bottom of the control Panel is aligned with the baseline of the text;
Texttop: The top of the control Panel is aligned to the top of the highest text in the current line;
Middle: The middle of the control Panel aligns with the baseline of the current line;
Absmiddle: The middle of the control Panel aligns 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, the code is as follows:
<embed src= "Your.mid" align=top> <embed src= "Your.mid" align=center>
4.<embed> Label Description text:
Syntax: title=#
Description: #为说明的文字. This attribute specifies the description text for an audio or video file.
example, the code is as follows:
<embed src= "Your.mid" title= "first song" >
5.<embed> Label 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: smaller panel;
PlayButton: Only the play button is displayed;
Pausebutton: Only the pause button is displayed;
Stopbutton: Only the Stop button is displayed;
Volumelever: Only the volume adjustment button is displayed.
example, the code is as follows:
<embed src= "Your.mid" controls=smallconsole> <embed src= "Your.mid" controls=volumelever>
6.<embed> Tag Auto Play:
Syntax: Autostart=true, False
Description: This property specifies whether an audio or video file will play automatically after it has been downloaded.
True: Music files are automatically played after downloading;
False: The music file does not play automatically after the download is complete.
example, the code is as follows:
<embed src= "Your.mid" autostart=true> <embed src= "Your.mid" autostart=false>
7.<embed> label loop playback:
Syntax: loop= positive integer, True, False
Description: This property specifies whether audio or video files are looped and cycled.
When the value of the property is a positive integer value, the number of cycles of the audio or video file is the same as the full 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, 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>
Tips and comments for html5<embed> tags:
Note The:<embed> label must have the SRC attribute.
Tip: You can't write text between the start and end tags to show that the old-fashioned browser doesn't support the tag, like <audio> and <video>.
The difference between HTML 4.01 and HTML 5:
The <embed> tag is a new label in HTML 5.
"Recommended"
What are the new structural elements of HTML5? HTML5 the use of new structural elements (recommended)
What are the article tags in HTML5? Where is the article element used in HTML5?